def excepthook( self, type_, value, tb ):
# emergency write
self.__session_log.write( 'excepthook called\n' )
self.__session_log.flush()
all_exception_lines = traceback.format_exception( type_, value, tb )
for line in all_exception_lines:
self.__session_log.write( line )
self.__session_log.flush()
# cannot use the GUI window now app is not sane
self.app.log.removeHandler( self.widget_log_handler )
self.app.log.error( 'excepthook called' )
for line in all_exception_lines:
self.app.log.error( line.replace( '\n', '' ) )
self.app.runInForeground( self.app.log.addHandler, (self.widget_log_handler,) )
self.app.runInForeground( self.app.log.error, ('Check log for traceback details',) )
评论列表
文章目录