From 2fd86c9eb6220ea565daf7a5be5a8a1e22750c60 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Wed, 10 Jun 2020 19:27:58 +0530 Subject: [PATCH] fix: populate bench.log via bench.utils.log --- bench/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bench/utils.py b/bench/utils.py index 7914eecd..d94fc26b 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -70,9 +70,16 @@ def log(message, level=0): 2: color.red + 'ERROR', # fail 3: color.yellow + 'WARN' # warn/suggest } + loggers = { + 2: logger.error, + 3: logger.warning + } + start_line = (levels.get(level) + ': ') if level in levels else '' + level_logger = loggers.get(level, logger.info) end_line = '\033[0m' + level_logger(message) print(start_line + message + end_line)