We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 548f4fc commit 6ba8f97Copy full SHA for 6ba8f97
1 file changed
aw_core/log.py
@@ -39,6 +39,14 @@ def setup_logging(
39
_create_file_handler(name, testing=testing, log_json=log_file_json)
40
)
41
42
+ def excepthook(type_, value, traceback):
43
+ root_logger.exception("Unhandled exception", exc_info=(type_, value, traceback))
44
+ # call the default excepthook if log_stderr isn't true (otherwise it'll just get duplicated)
45
+ if not log_stderr:
46
+ sys.__excepthook__(type_, value, traceback)
47
+
48
+ sys.excepthook = excepthook
49
50
51
def _get_latest_log_files(name, testing=False) -> List[str]: # pragma: no cover
52
"""Returns a list with the paths of all available logfiles for `name` sorted by latest first."""
0 commit comments