colourize the whole log message

This commit is contained in:
Bernardo Damele 2012-07-11 12:18:48 +01:00
parent 31571e6e2d
commit ff6ca6fb1a

View File

@ -125,12 +125,13 @@ class ColorizingStreamHandler(logging.StreamHandler):
def format(self, record):
message = logging.StreamHandler.format(self, record)
if self.is_tty:
# Don't colorize any traceback
parts = message.split('\n', 1)
parts[0] = self.colorize(parts[0], record)
message = '\n'.join(parts)
return message
#if self.is_tty:
# # Don't colorize any traceback
# parts = message.split('\n', 1)
# parts[0] = self.colorize(parts[0], record)
# message = '\n'.join(parts)
#return message
return self.colorize(message, record)
def main():
root = logging.getLogger()