Fix up shell-log, yet again

This commit is contained in:
Eryn Wells 2021-12-31 12:01:21 -08:00
parent e8bb002ff0
commit 74156cf2fc

View file

@ -17,7 +17,7 @@ LOG_LEVELS = {
'error': logging.ERROR,
'warn': logging.WARNING,
'info': logging.INFO,
'debug': logging.DEBUG
'debug': logging.DEBUG,
}
def parse_args():
@ -47,11 +47,11 @@ def main():
args = parse_args()
log = logger(args)
level = os.environ.get('SHELL_LOG_LEVEL', logging.INFO)
level = LOG_LEVELS[os.environ.get('SHELL_LOG_LEVEL', 'info')]
log.setLevel(level)
try:
message_log_level = LOG_LEVELS[args.level]
message_log_level = LOG_LEVELS[args.level]
except KeyError:
message_log_level = logging.INFO