Logging模块学习记录

时间:2017-07-27 15:11:42   收藏:0   阅读:259
默认情况下logging模块将大致打印到屏幕上,日志级别为 等于或高于WARNING 级别的日志信息才会输出。
日志级别等级CRITICAL > ERROR > WARNING > INFO > DEBUG > NOTSET
logger.addHandler(handler_warn)
logging.debug(‘This is debug message‘)
logging.info(‘This is info message‘)

logging.warn(‘This is warning message‘)
logging.error(‘error ‘)
logging.critical(‘critical ‘)


print:
WARNING:root:This is warning message
ERROR:root:error
CRITICAL:root:critical
技术分享

 




原文:http://www.cnblogs.com/Jonnyps/p/7244758.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!