Skip to content

Commit

Permalink
fix: populate bench.log via bench.utils.log
Browse files Browse the repository at this point in the history
  • Loading branch information
gavindsouza committed Jun 10, 2020
1 parent e26a0a9 commit 2fd86c9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bench/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit 2fd86c9

Please sign in to comment.