[Python-Dev] Logging with no handlers configured

Walter Dörwald walter at livinglogic.de
Thu Jul 22 12:26:37 CEST 2004


Vinay Sajip wrote:

> Currently, if the logging module is used with no handlers configured for a
> logger or its parents and you try to log events with that logger, a single
> message is printed to sys.stderr:
> 
> No handlers could be found for logger <logger name>
> 
> It has been suggested that this puts out a spurious message when, for
> whatever reason, a developer intentionally does not configure any
> handlers.
 > [...]
>
> All feedback gratefully received,

How about a LoggingConfigurationWarning and using warnings.warn()?
Then what should happen with the warning (ignore, print, raise
exception) could be configured via the warning framework.

Bye,
    Walter Dörwald



More information about the Python-Dev mailing list