Message262962
Currently all the stdlib logging handlers (except BufferingHandler) emit method have the following structure:
def emit(self, record):
try:
// do the emit
except Exception:
self.handleError(record)
I suggest changing this so that the handle method will do the exception handling of the emit:
def handle(self, record):
rv = self.filter(record)
if rv:
self.acquire()
try:
self.emit(record)
except Exception:
self.handleError(record)
finally:
self.release()
return rv
Now the emit() method can be override without the need to handle it's own exceptions.
I think this is more clear with the current documentation as well. For example in the handleError function it says that "This method should be called from handlers when an exception is encountered during an emit() call". In addition in the only example that implement the emit() function https://docs.python.org/3/howto/logging-cookbook.html#speaking-logging-messages there is no error handling at all. |
|
Date |
User |
Action |
Args |
2016-04-06 20:03:38 | palaviv | set | recipients:
+ palaviv, vinay.sajip |
2016-04-06 20:03:37 | palaviv | set | messageid: <1459973017.82.0.820573021891.issue26705@psf.upfronthosting.co.za> |
2016-04-06 20:03:37 | palaviv | link | issue26705 messages |
2016-04-06 20:03:37 | palaviv | create | |
|