Fixed weird formatting of colorized stdout stuff.

This commit is contained in:
Jeremy Fincher 2004-08-08 17:59:49 +00:00
parent 8a4e79e007
commit b7bd3d414e

View File

@ -137,9 +137,12 @@ class ColorizedFormatter(Formatter):
color = ansi.RED
elif record.levelno == logging.WARNING:
color = ansi.YELLOW
return ''.join([color,
Formatter.format(self, record, *args, **kwargs),
ansi.RESET])
if color:
return ''.join([color,
Formatter.format(self, record, *args, **kwargs),
ansi.RESET])
else:
return Formatter.format(self, record, *args, **kwargs)
else:
return Formatter.format(self, record, *args, **kwargs)