The basics of the logging module mystify me

Albert-Jan Roskam sjeik_appie at
Fri Apr 20 04:46:36 EDT 2018

On Apr 19, 2018 03:03, Skip Montanaro <skip.montanaro at> wrote:
> I really don't like the logging module, but it looks like I'm stuck
> with it. Why aren't simple/obvious things either simple or obvious?

Agreed. One thing that, in my opinion, ought to be added to the docs is sample code to log uncaught exceptions using an excepthook, with correctly formatted traceback.

Another thing I always do is to define a custom log level named 'message', which is always logged. Basically it's logging.FATAL + 1, but with a friendlier label. Would be a nice enhancement of the logging module IMHO.

More information about the Python-list mailing list