[Python-Dev] Consistent logging in the standard library

Vinay Sajip vinay_sajip at yahoo.co.uk
Wed Sep 17 17:43:58 EDT 2003

A recent thread has discussed integrating logging with the rest of the
standard library. Among other things, a question has arisen about what
logging channel names standard library modules should use, and possible
clashes with channel names used by applications.

I'd like to propose that some portion of the namespace be reserved for use
by logging in the standard library. If acceptable, all that would need to be
done would be to update the documentation to indicate the namespace
reservation. The actual use of the namespace could be implemented as and
when each module is changed to use the logging module.

The scheme of having all standard library logging under one umbrella allows
applications to be configured so that all library-level messages can be
routed to specific handlers, filtered simply at one point, etc.

My preference for namespace reservation is that any logger name beginning
with "python." should be reserved for use by the standard distribution. I
think that each module should use an eponymous logging channel name rooted
in the hierarchy for the Python library - e.g. asyncore would use
"python.asyncore", etc.

Matthew Barnes, who kicked off the original thread, prefers "stdlib" as the
prefix to use, rather than "python".

Comments, please!

Vinay Sajip

More information about the Python-Dev mailing list