mirror of
https://github.com/frappe/bench.git
synced 2025-01-09 16:36:25 +00:00
fix: populate bench.log via bench.utils.log
This commit is contained in:
parent
e26a0a9b37
commit
2fd86c9eb6
@ -70,9 +70,16 @@ def log(message, level=0):
|
|||||||
2: color.red + 'ERROR', # fail
|
2: color.red + 'ERROR', # fail
|
||||||
3: color.yellow + 'WARN' # warn/suggest
|
3: color.yellow + 'WARN' # warn/suggest
|
||||||
}
|
}
|
||||||
|
loggers = {
|
||||||
|
2: logger.error,
|
||||||
|
3: logger.warning
|
||||||
|
}
|
||||||
|
|
||||||
start_line = (levels.get(level) + ': ') if level in levels else ''
|
start_line = (levels.get(level) + ': ') if level in levels else ''
|
||||||
|
level_logger = loggers.get(level, logger.info)
|
||||||
end_line = '\033[0m'
|
end_line = '\033[0m'
|
||||||
|
|
||||||
|
level_logger(message)
|
||||||
print(start_line + message + end_line)
|
print(start_line + message + end_line)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user