#logging模块
import logging
#日志级别 系统默认级别是warning 所以只打印出来3条日志,
# 这五条打印结果是WARNING:root:warning message ERROR:root:error message CRITICAL:root:critical message
# logging.debug('debug message')
# logging.info('info message')
# logging.warning('warning message')
# logging.error('error message')
# logging.critical('critical message')
#这个是系统的方法,可以看一下各个参数的解释
# def basicConfig(**kwargs):
# """
# Do basic configuration for the logging system.
#
# This function does nothing if the root logger already has handlers
# configured. It is a convenience method intended for use by simple scripts
# to do one-shot configuration of the logging package.
#
# The default behaviour is to create a StreamHandler which writes to
# sys.stderr, set a formatter using the BASIC_FORMAT format string, and
# add the handler to the root logger.
#
# A number of optional keyword arguments may be specified, which can alt
日志模块
最新推荐文章于 2023-08-24 06:23:58 发布