From: Ben Darnell Date: Sun, 4 Aug 2013 19:45:35 +0000 (-0400) Subject: Route all callback error logging in IOLoop through handle_callback_exception. X-Git-Tag: v3.2.0b1~103 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfba45ba1441c359ac0ad742d8cce47d047a530c;p=thirdparty%2Ftornado.git Route all callback error logging in IOLoop through handle_callback_exception. --- diff --git a/tornado/ioloop.py b/tornado/ioloop.py index fc61904e1..c9f2e47c5 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -682,11 +682,9 @@ class PollIOLoop(IOLoop): # Happens when the client closes the connection pass else: - app_log.error("Exception in I/O handler for fd %s", - fd, exc_info=True) + self.handle_callback_exception(self._handlers.get(fd)) except Exception: - app_log.error("Exception in I/O handler for fd %s", - fd, exc_info=True) + self.handle_callback_exception(self._handlers.get(fd)) # reset the stopped flag so another start/stop pair can be issued self._stopped = False if self._blocking_signal_threshold is not None: @@ -820,7 +818,7 @@ class PeriodicCallback(object): try: self.callback() except Exception: - app_log.error("Error in periodic callback", exc_info=True) + self.io_loop.handle_callback_exception(self.callback) self._schedule_next() def _schedule_next(self):