logging exceptions

Rob Wolfe rw at smsnet.pl
Tue Aug 26 08:09:03 EDT 2008



Alexandru Mosoi napisał(a):
> why doesn't logging throw any exception when it should? how do I
> configure logging to throw exceptions?
>
> >>> try:
> ...   logging.fatal('asdf %d', '123')
> ... except:
> ...   print 'this line is never printed'
> ...

[...]

You need to subclass your handler and redefine `handleError` method.
See: http://docs.python.org/lib/node409.html

HTH,
Rob



More information about the Python-list mailing list