2021-07-08 20:42:22 +08:00
|
|
|
"""
|
|
|
|
writen by shenjackyuanjie
|
|
|
|
mail: 3695888@qq.com
|
|
|
|
github: @shenjackyuanjie
|
|
|
|
"""
|
|
|
|
import configparser
|
2021-09-05 00:50:05 +08:00
|
|
|
import logging.config
|
2021-07-08 20:42:22 +08:00
|
|
|
|
|
|
|
configs = configparser.ConfigParser()
|
|
|
|
configs.read('logging.config')
|
|
|
|
# configs['version'] = 1
|
|
|
|
|
|
|
|
# logging.config.dictConfig(configs)
|
|
|
|
logging.config.fileConfig('logging.config')
|
|
|
|
logger = logging.getLogger('simpleExample')
|
|
|
|
|
|
|
|
logger.debug('debug message')
|
|
|
|
logger.info('info message')
|
|
|
|
logger.warning('warn message')
|
|
|
|
logger.error('error message')
|
|
|
|
logger.critical('critical message')
|