Wiadomość napisana przez Antoine Pitrou w dniu 2010-12-07, o godz. 21:50:

> 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).

ISTM that the stdlib is a special case here. If you're writing an application 
then the "No handlers could be found" message is actually useful because 
there's hardly any reason no to include one.

If you're writing a library, well, that depends. Part of libraries might want 
to have their specific default handlers, part of them might want to leave that 
to the library user (e.g. "No handlers can be found" by default) and part of 
them might want to silence logs by default.

One way or the other, we should really default to the convenience of 
application developers. This is currently the case.

-- 
Best regards,
Łukasz Langa
tel. +48 791 080 144
WWW http://lukasz.langa.pl/

_______________________________________________
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