Skip to content

Commit

Permalink
Core: Deduplicate exception output (#4036)
Browse files Browse the repository at this point in the history
When running Generate.py, uncaught exceptions are logged once to a file and twice to the console due to keeping the original excepthook. We can avoid this by filtering the file log out of the stream handler.
  • Loading branch information
Zannick authored Dec 15, 2024
1 parent 0370e66 commit 0fdc14b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,8 @@ def handle_exception(exc_type, exc_value, exc_traceback):
sys.__excepthook__(exc_type, exc_value, exc_traceback)
return
logging.getLogger(exception_logger).exception("Uncaught exception",
exc_info=(exc_type, exc_value, exc_traceback))
exc_info=(exc_type, exc_value, exc_traceback),
extra={"NoStream": exception_logger is None})
return orig_hook(exc_type, exc_value, exc_traceback)

handle_exception._wrapped = True
Expand Down

0 comments on commit 0fdc14b

Please sign in to comment.