Minor bug fix (level names not properly used in non-logger output)

This commit is contained in:
Miroslav Stampar 2013-05-18 16:44:21 +02:00
parent f24c8c6b6b
commit b2b3b3b5a6

View File

@ -760,6 +760,7 @@ def setColor(message, bold=False):
if bold: if bold:
retVal = colored(message, color=None, on_color=None, attrs=("bold",)) retVal = colored(message, color=None, on_color=None, attrs=("bold",))
elif level: elif level:
level = getattr(logging, level, None) if isinstance(level, basestring) else level
_ = LOGGER_HANDLER.level_map.get(level) _ = LOGGER_HANDLER.level_map.get(level)
if _: if _:
background, foreground, bold = _ background, foreground, bold = _