format_exc()返回字符串,print_exc()则直接给打印出来

logger.info("start_game =other_params '%s'" % traceback.format_exc())

 

format_exc()返回字符串,print_exc()则直接给打印出来

 

except Exception,e:

print e

 

except Exception,e:

traceback.print_exec()

直接打印e 没有具体错误信息,使用format_exc()或者print_exc()都可以获取具体出错的文件,行数

 

猜你喜欢

转载自blog.csdn.net/qq_42091922/article/details/85266582