[Python-Dev] Problems with regrtest and with logging

Vinay Sajip vinay_sajip at yahoo.co.uk
Wed May 11 21:45:12 CEST 2011

Éric Araujo <merwok <at> netwok.org> writes:

>  I thought that if we set the level on the logger, we would prevent 
>  third-party code to get some messages.  E.g., we set level to INFO but 
>  pip uses some packaging functions and would like to get DEBUG messages.

Then pip can set the level of the packaging logger as it wishes, perhaps in
response to command-line arguments for verbosity. It'd be easier for pip to do
that, regardless of which handlers are attached. And pip itself might be being
used, say by virtualenv. It's hard in general to say what the top-level code
will be, and generally that's the code which should set the handlers.

The levels set by a library for its loggers are merely defaults. Applications
using the library can choose to override those levels as they wish.


Vinay Sajip

More information about the Python-Dev mailing list