wb_logging.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:scm-workbench 作者: barry-scott 项目源码 文件源码
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',) )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号