'Formats a record for output.
This implementation colorizes the message line, but leaves
any traceback unolorized.'

def format(self, record):

    message = logging.StreamHandler.format(self, record)
    if self.is_tty:
        parts = message.split('\n', 1)
        parts[0] = self.colorize(parts[0], record)
        message = '\n'.join(parts)
    return message
