diff options
| author | 2018-12-12 11:33:29 +0000 | |
|---|---|---|
| committer | 2018-12-12 11:33:29 +0000 | |
| commit | 85840a68ddc5b012a2de038155036ec1113f5b5f (patch) | |
| tree | b352c77476045eba6225cb3cd82d00b46bd3defa | |
| parent | Typo, 'requestl' -> 'request' (wolframalpha.py) (diff) | |
| signature | ||
Preserve logged exc_info across threads
| -rw-r--r-- | src/Logging.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Logging.py b/src/Logging.py index 53275686..60c008a6 100644 --- a/src/Logging.py +++ b/src/Logging.py @@ -77,4 +77,8 @@ class Log(object): def critical(self, message: str, params: typing.List, **kwargs): self._log(message, params, logging.CRITICAL, kwargs) def _log(self, message: str, params: typing.List, level: int, kwargs: dict): + if kwargs.get("exc_info") == True: + # because we're doing the actual logging on another thread, + # we need to catch actual exception information here. + kwargs["exc_info"] = sys.exc_info() self._queue.put((message, params, level, kwargs)) |
