python提供了一个日志处理的模块,那就是logging 导入logging模块使用以下命令: import logging logging模块的用法: 1.简单的将日志打印到屏幕上 import logging logging.debug("This is debug message") logging.info("This is info message") logging.warning("This is warning message"…
一.logging模块 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将日志打印到屏幕,日志级别为WARNING: 日志级别大小关系为:CRITICAL > ERR…