标签:
一、简单的将日志打印到屏幕
>>> import logging
>>> logging.debug("This is debug message")
>>> logging.info("This is info message")
>>> logging.warning("This is warning message")
WARNING:root:This is warning message
>>> logging.error("This is error message")
ERROR:root:This is error message
>>> logging.critical("This is critical message")
CRITICAL:root:This is critical message
日志级别大小关系为:CRITICAL > ERROR > WARNING > INFO > DEBUG > NOTSET,当然也可以自己定义日志级别。
标签:
原文地址:http://www.cnblogs.com/skyer/p/5629749.html