Bootstrap

python try: except: 捕获到的异常输出到 log文件

import logging
# 默认__name__ ,可更改
logging.basicConfig(filename='../LOG/'+__name__+'.log',format='[%(asctime)s-%(filename)s-%(levelname)s:%(message)s]', level = logging.DEBUG,filemode='a',datefmt='%Y-%m-%d%I:%M:%S %p')

点击查看原文

;