Core: Deduplicate exception output (#4036)
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.
This commit is contained in:
parent
0370e669e5
commit
0fdc14bc42
3
Utils.py
3
Utils.py
|
@ -534,7 +534,8 @@ def init_logging(name: str, loglevel: typing.Union[str, int] = logging.INFO,
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue