diff options
author | David Robertson <davidr@element.io> | 2022-05-13 12:35:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-13 12:35:31 +0100 |
commit | aec69d2481e9ea1d8ea1c0ffce1706a65a7896a8 (patch) | |
tree | 1017693baaa1bd87632b3a252395bb5a8503d1c3 /synapse/logging/formatter.py | |
parent | SpamChecker metrics (#12513) (diff) | |
download | synapse-aec69d2481e9ea1d8ea1c0ffce1706a65a7896a8.tar.xz |
Another batch of type annotations (#12726)
Diffstat (limited to 'synapse/logging/formatter.py')
-rw-r--r-- | synapse/logging/formatter.py | 14 |
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 |