From b745ead70ad37cbea08bba26541535e83e5829f8 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 6 Apr 2022 14:05:35 +0800 Subject: [PATCH] bugfix --- appPublic/app_logger.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/appPublic/app_logger.py b/appPublic/app_logger.py index 8ae21d7..7c0c6ec 100644 --- a/appPublic/app_logger.py +++ b/appPublic/app_logger.py @@ -9,17 +9,16 @@ levels={ "error":logging.error, "critical":logging.CRITICAL } -defaultfmt = '%(asctime)s[%(name)s][%(filename)s:%(lineno)s]%(message)s' +defaultfmt = '%(asctime)s[%(name)s][%(levelname)s][%(filename)s:%(lineno)s]%(message)s' logfile = -1 -level = None +level = levels.get('info') def create_logger(name, formater=defaultfmt, levelname='info', file=None): global logfile, level if logfile == -1: logfile = file ret = logging.getLogger(name) - if level is None: - level = levels.get(levelname, levels.get('debug')) + level = levels.get(levelname, levels.get('info')) ret.setLevel(level) format = logging.Formatter(formater) file_handler = None