On Wed, Dec 8, 2010 at 8:19 AM, Paul Moore <p.f.mo...@gmail.com> wrote:
> But you don't because the library developer added a NullHandler which
> you have to switch off!!!

I'm suspecting there's misunderstanding on this point.

If I have a logger "myns.mypackage" for my library, and register a
NullHandler for that, that doesn't need to be turned off for
applications.  What it accomplishes is that for all messages sent to
the "myns.mypackage" logger (and descendants) are handled by at least
one handler.  Log records are still propagated toward the root for
outer loggers to handle.  An application can also still choose to
install additional handlers for "myns.mypackage" if desired, and do
whatever output handling is appropriate.

The library-installed NullHandler on a library-scoped logger simply
ensures that the library doesn't trigger the message about un-handled
log records.

We seem to have consensus on not wanting that message triggered for
library logging is desirable, and this NullHandler trick provides a
way to handle that independent from other possible changes.


  -Fred

--
Fred L. Drake, Jr.    <fdrake at acm.org>
"A storm broke loose in my mind."  --Albert Einstein
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to