This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author chris.jerdonek
Recipients ajs, chris.jerdonek, docs@python, vinay.sajip
Date 2013-01-29.18:45:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1359485101.24.0.00307093721047.issue17075@psf.upfronthosting.co.za>
In-reply-to
Content
> This documentation states that libraries can turn off logging by adding a NullHandler:

I don't think that's what the documentation says.  It says, "If for some reason you don’t want these messages printed *in the absence of any logging configuration* [my emphasis]....  If the library user configures logging for application use, presumably that configuration will add some handlers, and if levels are suitably configured then logging calls made in library code will send output to those handlers, as normal."

In other words, the documentation is acknowledging that logging won't get turned off if something else configures it.  This is the same as what you say further on:

> It only holds true if the application which calls the library has not called basicConfig on the root logger.

If there's some other part of the documentation that says otherwise, can you include a direct quote in the comment so we know what words you are referencing?

> The correct way for a library to silence log messages is to both set a NullHandler and set propagate to false.

This doesn't sound like good practice to me and isn't what the current docs were trying to say.
History
Date User Action Args
2013-01-29 18:45:01chris.jerdoneksetrecipients: + chris.jerdonek, vinay.sajip, ajs, docs@python
2013-01-29 18:45:01chris.jerdoneksetmessageid: <1359485101.24.0.00307093721047.issue17075@psf.upfronthosting.co.za>
2013-01-29 18:45:01chris.jerdoneklinkissue17075 messages
2013-01-29 18:45:01chris.jerdonekcreate