python logging module problem

Vinay Sajip vinay_sajip at yahoo.co.uk
Fri Jul 14 05:02:09 EDT 2006


Ritesh Raj Sarraf wrote:

> When I execute the above code, logger.info()'s messages don't get
> displayed. And logger.warning()'s messages get displayed twice.
>

The warning messages are displayed twice because you have two handlers
which both output to the console.

The reason you don't get the info messages is that you haven't set a
level on the logger, so the default of WARNING is used.

It's usual to rely on logger levels and to set handler levels for
additional refinement of what goes to a particular handler's
destination.

Regards,

Vinay Sajip




More information about the Python-list mailing list