aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2018-12-12 11:33:29 +0000
committerGravatar jesopo2018-12-12 11:33:29 +0000
commit85840a68ddc5b012a2de038155036ec1113f5b5f (patch)
treeb352c77476045eba6225cb3cd82d00b46bd3defa
parentTypo, 'requestl' -> 'request' (wolframalpha.py) (diff)
signature
Preserve logged exc_info across threads
-rw-r--r--src/Logging.py4
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))