Re: Logging all uncaught exceptions

2014-07-14 Thread Steven D'Aprano
On Mon, 14 Jul 2014 19:21:44 +1000, Chris Angelico wrote: > On Mon, Jul 14, 2014 at 7:07 PM, Steven D'Aprano > wrote: >> but the exception info which should have been generated by >> mylogger.exception doesn't appear anywhere I can see. >> >> >> What am I doing wrong? > > I'm not specifically fa

Re: Logging all uncaught exceptions

2014-07-14 Thread Chris Angelico
On Mon, Jul 14, 2014 at 7:07 PM, Steven D'Aprano wrote: > but the exception info which should have been generated by > mylogger.exception doesn't appear anywhere I can see. > > > What am I doing wrong? I'm not specifically familiar with the logging module, but something I'd look at would be 'ls /

Re: Logging all uncaught exceptions

2014-07-14 Thread Steven D'Aprano
On Mon, 14 Jul 2014 06:09:32 +, Steven D'Aprano wrote: > I want to catch all uncaught exceptions in my application, log them, > then handle as normal. Which, in practice, means a traceback. Is this > the right way to do it? I think I've answered my own question, which leads to the next questi

Logging all uncaught exceptions

2014-07-13 Thread Steven D'Aprano
I want to catch all uncaught exceptions in my application, log them, then handle as normal. Which, in practice, means a traceback. Is this the right way to do it? import logging import sys logger = logging.getLogger('mylogger') def my_handler(type, value, tb): msg = "Uncaught %s: %s" % (