[Python-Dev] Problems with regrtest and with logging

Éric Araujo merwok at netwok.org
Fri May 13 19:56:28 CEST 2011


Le 11/05/2011 21:45, Vinay Sajip a écrit :
> É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.
Okay.  I’ll go ahead and remove handlers (except for the command-line
script), and set the level on the logger.  If it turns out that the code
in packaging incorrectly resets the level set by calling code, we’ll fix
it later; now we want to fix the tests to produce the patch that will
add packaging to CPython.

> The levels set by a library for its loggers are merely defaults.
The conflict here is that there’s a class setting the logging level on
instantiation, which could reset the level set by calling code.

Thanks again for your messages (and blog).


More information about the Python-Dev mailing list