def _log_all_uncaught_exceptions(exc_type, exc_value, exc_traceback):
"""Log all uncaught exceptions in non-interactive mode.
All python exceptions are handled by function, stored in
``sys.excepthook.`` By rewriting the default implementation, we
can modify handling of all uncaught exceptions.
Warning: modified behaviour (logging of all uncaught exceptions)
applies only when runing in non-interactive mode.
"""
# ignore KeyboardInterrupt
if not issubclass(exc_type, KeyboardInterrupt):
ROOT_LOGGER.error("", exc_info=(exc_type, exc_value, exc_traceback))
sys.__excepthook__(exc_type, exc_value, exc_traceback)
return
# Rewrite the default implementation os sys.excepthook to log all
# uncaught exceptions:
评论列表
文章目录