Am 08.12.2010 13:22, schrieb Vinay Sajip:
> Antoine Pitrou <solipsis <at> pitrou.net> writes:
> 
>> 
>> On Wed, 08 Dec 2010 11:48:16 +0100
>> Georg Brandl <g.brandl <at> gmx.net> wrote:
>   But hopefully standard
>> > library modules don't use it to report exceptions to code that uses them?
>> 
>> I'm not aware of that, but there are certainly third-party libs using
>> it (think an HTTP server that wants to log an error in one of its
>> request handlers without the error taking the whole server down).
>> 
> 
> That's not the same thing as Georg is talking about, IIUC. The exception()
> method is used in exception *handler* code to record that the exception
> occurred, but the correct thing for any code to do when an error condition is
> detected (in most situations at least) is to raise an exception. It would be
> quite wrong for code to e.g. call logger.error(...) instead of raise ...

Exactly.  The HTTP server is of course a good example of an application, and
one of the most obvious candidates in the stdilb to use the logging module
instead of sys.stderr.write().

Georg

_______________________________________________
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