修复了多重log

This commit is contained in:
Pentacene 2021-03-04 01:03:48 +08:00 committed by GitHub
parent ccfaeac063
commit 2525dd5dcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,9 @@ logs = getLogger(__name__)
logging_format = "%(levelname)s [%(asctime)s] [%(name)s] %(message)s" logging_format = "%(levelname)s [%(asctime)s] [%(name)s] %(message)s"
logging_handler = StreamHandler() logging_handler = StreamHandler()
logging_handler.setFormatter(ColoredFormatter(logging_format)) logging_handler.setFormatter(ColoredFormatter(logging_format))
logs.addHandler(logging_handler) root_logger = getLogger()
root_logger.setLevel(logging.ERROR)
root_logger.addHandler(logging_handler)
basicConfig(level=INFO) basicConfig(level=INFO)
logs.setLevel(INFO) logs.setLevel(INFO)