def configure_logging(config):
logging.config.dictConfig(config)
# By default the install() function installs a handler on the root logger,
# this means that log messages from your code and log messages from the
# libraries that you use will all show up on the terminal.
coloredlogs.install(level=logging.DEBUG,
fmt='%(asctime)s %(levelname)-8s %(message)s',
datefmt='%Y-%m-%d %H:%I:%S')
logging.getLogger('requests').setLevel(logging.WARNING)
logging.getLogger('urllib3.connectionpool').setLevel(logging.WARNING)
if sys.stdout.isatty():
colorama.init(autoreset=True)
else:
# We're being piped, so skip colors
colorama.init(strip=True)
评论列表
文章目录