logging 模块

#_author:star
#date:2019/11/6
#logging 模块
import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(filename)s [line:%(lineno)d] %(levelname)s %(message)s',
datefmt='%a,%d %b %y %H %M %S',
filename='test.log',)
#filemode='a')
logging.debug('debug message11')
logging.info('info message11')
logging.warning('warning message11')
logging.error('error message')
logging.critical('critical message11')
Output:


posted @ 2019-11-06 22:33  Stary_tx  阅读(130)  评论(0编辑  收藏  举报