'Formats the string representation of record.
:param logging.LogRecord record: Record to be formatted
:returns: Formatted, string representation of record
:rtype: str'

def format(self, record):

    out = (logging.StreamHandler.format(self, record) if (sys.version_info < (2, 7)) else super(ColoredStreamHandler, self).format(record))
    if (self.colored and (record.levelno >= self.red_level)):
        return ''.join((util.ANSI_SGR_RED, out, util.ANSI_SGR_RESET))
    else:
        return out
