vim logger_config.ini[loggers]keys=root,infoLogger,errorlogger [logger_root]level=DEBUGhandlers=infohandler,errorhandler [logger_infoLogger]handlers=infohandlerqualname=infoLoggerpropagate=0 [logger_errorlogger]handlers=errorhandlerqualname=errorlogg…
1.基本的用法 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 > ERROR >…