def exception_hook(exctype, value, tb):
"""
Catch any unhandled exception and print its stack trace.
Useful to see what is going on when scrapper crashes.
"""
logger = logging.getLogger('main')
logger.critical('{0}: {1}'.format(exctype, value))
logger.critical(''.join(traceback.format_tb(tb)))
评论列表
文章目录