[Python-Dev] Using logging in the stdlib and its unit tests

Nick Coghlan ncoghlan at gmail.com
Wed Dec 8 15:56:14 CET 2010


On Thu, Dec 9, 2010 at 12:43 AM, Fred Drake <fdrake at acm.org> wrote:
> On Wed, Dec 8, 2010 at 9:27 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:
>> The thing is, they don't *want* to configure them, but you force them
>> to do some configuration if they don't want error messages to be
>> silenced.
>
> As I tried to explain earlier, a NullHandler doesn't silence anything
> except the message about logging not being configured. Propagation is
> not controlled by the handlers, but by the loggers.

If the only handler is NullHandler though, (or if there are no
handlers configured at all) then output does get silenced by default,
even errors and warning messages. The application has to (directly or
indirectly) configure logging with additional handlers in order for
the output to appear somewhere. That's the behaviour that is
inappropriate for use cases like the concurrent.futures handling of
unraisable errors that started this discussion over on the bug
tracker.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list