logging - how to use in a library?

Vinay Sajip vinay_sajip at yahoo.co.uk
Wed Aug 27 09:34:17 EDT 2008


On Aug 27, 11:28 am, Thomas Heller <thel... at python.net> wrote:
> Vinay Sajip schrieb:
>
> I came up with a workaround that seems to do what I want.  I add a NULL handler
> to my top-level logger which is not the root logger but a logger named 'comtypes',
> other loggers are named 'comtypes.something...'.  So the application developer
> using the library will not see any comtypes logger messages at all, unless
> he calls 'logging.basicConfig()', for example.
>

This is a good solution - I'll add this as a suggestion in the
documentation.

Regards,

Vinay Sajip



More information about the Python-list mailing list