From 6163d4e9eace6143fe01e652f5521bbca4bf5bcf Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 10 Jul 2018 17:28:29 -0400 Subject: [PATCH] Don't create formatter if no log level set --- tractor/log.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tractor/log.py b/tractor/log.py index e57dc33..026716b 100644 --- a/tractor/log.py +++ b/tractor/log.py @@ -67,8 +67,10 @@ def get_console_log(level: str = None, name: str = None) -> logging.Logger: ''' log = get_logger(name) # our root logger - if level: - log.setLevel(level.upper() if not isinstance(level, int) else level) + if not level: + return + + log.setLevel(level.upper() if not isinstance(level, int) else level) if not any( handler.stream == sys.stderr for handler in log.handlers