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): def format(self, record):
message = logging.StreamHandler.format(self, record) message = logging.StreamHandler.format(self, record)
if self.is_tty: #if self.is_tty:
# Don't colorize any traceback # # Don't colorize any traceback
parts = message.split('\n', 1) # parts = message.split('\n', 1)
parts[0] = self.colorize(parts[0], record) # parts[0] = self.colorize(parts[0], record)
message = '\n'.join(parts) # message = '\n'.join(parts)
return message #return message
return self.colorize(message, record)
def main(): def main():
root = logging.getLogger() root = logging.getLogger()