def METHOD_NAME(self, rec):
    try:
        msg = rec.msg.decode('utf-8')
    except Exception:
        msg = rec.msg
    use = colors_lst['USE']
    if (use == 1 and rec.stream.isatty()) or use == 2:
        c1 = getattr(rec, 'c1', None)
        if c1 is None:
            c1 = ''
            if rec.levelno >= logging.ERROR:
                c1 = colors.RED
            elif rec.levelno >= logging.WARNING:
                c1 = colors.YELLOW
            elif rec.levelno >= logging.INFO:
                c1 = colors.GREEN
        c2 = getattr(rec, 'c2', colors.NORMAL)
        msg = '%s%s%s' % (c1, msg, c2)
    else:
        msg = re.sub(r'\r(?!\n)|\x1B\[(K|.*?(m|h|l))', '', msg)
    if rec.levelno >= logging.INFO:
        if rec.args:
            try:
                return msg % rec.args
            except UnicodeDecodeError:
                return msg.encode('utf-8') % rec.args
        return msg
    rec.msg = msg
    rec.c1 = colors.PINK
    rec.c2 = colors.NORMAL
    return logging.Formatter.METHOD_NAME(self, rec)