Skip to content Skip to sidebar Skip to footer

Python: Sys.excepthook And Logging Uncaught Exceptions Across Multiple Modules

In all of my Python main scripts and modules, I have been trying to implement a way to log uncaught exceptions to the module in which the exception was thrown's logger. I'm doing

Solution 1:

sys.excepthook is global for your Python process. The last value that you set to it wins. Using unique names in different files for module loggers won't have any effect on it.


Post a Comment for "Python: Sys.excepthook And Logging Uncaught Exceptions Across Multiple Modules"