summary refs log tree commit diff
path: root/synapse/logging/formatter.py
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2022-05-13 12:35:31 +0100
committerGitHub <noreply@github.com>2022-05-13 12:35:31 +0100
commitaec69d2481e9ea1d8ea1c0ffce1706a65a7896a8 (patch)
tree1017693baaa1bd87632b3a252395bb5a8503d1c3 /synapse/logging/formatter.py
parentSpamChecker metrics (#12513) (diff)
downloadsynapse-aec69d2481e9ea1d8ea1c0ffce1706a65a7896a8.tar.xz
Another batch of type annotations (#12726)
Diffstat (limited to 'synapse/logging/formatter.py')
-rw-r--r--synapse/logging/formatter.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/synapse/logging/formatter.py b/synapse/logging/formatter.py
index c0f12ecd15..c88b8ae545 100644
--- a/synapse/logging/formatter.py
+++ b/synapse/logging/formatter.py
@@ -16,6 +16,8 @@
 import logging
 import traceback
 from io import StringIO
+from types import TracebackType
+from typing import Optional, Tuple, Type
 
 
 class LogFormatter(logging.Formatter):
@@ -28,10 +30,14 @@ class LogFormatter(logging.Formatter):
     where it was caught are logged).
     """
 
-    def __init__(self, *args, **kwargs):
-        super().__init__(*args, **kwargs)
-
-    def formatException(self, ei):
+    def formatException(
+        self,
+        ei: Tuple[
+            Optional[Type[BaseException]],
+            Optional[BaseException],
+            Optional[TracebackType],
+        ],
+    ) -> str:
         sio = StringIO()
         (typ, val, tb) = ei