项目场景:logging的使用的过程
问题描述:
import logging ## 这里是来输出一些日志的相关的信息的
logging.debug(“This is a debug log.”)
logging.info(“this is a info log.”)
logging.warning(“this is a warning log.”) ##因为这里这里只有警告以上级别的文章才能够被输出
logging.error(“This is a error log.”)
logging.critical(“This is a critical log.”)
结果:
WARNING:root:this is a warning log.
ERROR:root:This is a error log.
CRITICAL:root:This is a critical log.