On Tue, 7 Dec 2010 20:26:06 +0000 (UTC)
Vinay Sajip <vinay_sa...@yahoo.co.uk> wrote:
> 
> >From my perspective and as mentioned in the logging documentation, library 
> >code
> which uses logging should add a NullHandler instance to any top-level logger,
> which will avoid any "No handlers could be found for logger XXX" message if no
> logging handlers have been set up. This applies to stdlib code, too, though it
> would be good if a logger namespace could be agreed for stdlib usage. (The
> logging package itself uses the logger "py.warnings" to redirect warnings to
> logging when configured to do so. Perhaps we could standardize on "py.XXX" for
> stdlib usage?)

I thought "error" and "critical" messages were logged to stderr by
default? Isn't it the case?

If any library defining a logger must also add a NullHandler just in
case, ISTM that complicates a lot the use of logging (and could explain
its impopularity). Both for library writers and application writers,
apparently (since the former will have to add the NullHandler, and the
latter will have to override it so that error messages get printed out
rather than lost).

Regards

Antoine.


_______________________________________________
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