def METHOD_NAME(self, record):
    if not self.stream.isatty():
        return logging.StreamHandler.METHOD_NAME(self, record)
    s = ''
    d = datetime.fromtimestamp(record.created)
    s += colored(d.strftime("%d.%m.%Y %H:%M:%S  "), 'white')
    params = {
        'tag': getattr(record, 'tag', 'master'),
        'pid': getattr(record, 'pid', os.getpid()),
    }
    process_tag = ''
    padding = ''
    if params['tag'] == 'master':
        if os.getpid() == LOG_PARAMS['master_pid']:
            process_tag = colored('master', 'yellow')
        else:
            params['tag'] = None
    if params['tag'] == 'restricted':
        process_tag = colored('rstrct', 'red')
        padding = '  '
    if params['tag'] == 'worker':
        process_tag = colored('worker', 'green')
        padding = '  '
    if params['tag'] == 'task':
        process_tag = colored('task  ', 'blue')
        padding = '    '
    if params['tag'] is None:
        process_tag = colored('...   ', 'blue')
        padding = '  '
    s += colored('[', 'white')
    s += process_tag
    s += colored(' %5i]  ' % params['pid'], 'white')
    if aj.debug:
        s += colored(
            ('%15s:%-4s  ' % (record.filename[-15:], record.lineno)),
            'magenta',
            attrs=['bold']
        )
    l = ''
    if record.levelname == 'DEBUG':
        l = colored('DEBUG', 'white')
    if record.levelname == 'INFO':
        l = colored('INFO ', 'green', attrs=['bold'])
    if record.levelname == 'WARNING':
        l = colored('WARN ', 'yellow', attrs=['bold'])
    if record.levelname == 'ERROR':
        l = colored('ERROR', 'red', attrs=['bold'])
    s += l + '  '
    s += padding
    try:
        s += record.msg % record.args
    except TypeError:
        # Not enough arguments can be caused by encoded URL
        s += record.msg
    s += '\n'
    self.stream.write(s)