':arg bool color: Enables color support.
:arg string fmt: Log message format.
It will be applied to the attributes dict of log records. The
text between ``%(color)s`` and ``%(end_color)s`` will be colored
depending on the level if color support is on.
:arg dict colors: color mappings from logging level to terminal color
code
:arg string datefmt: Datetime format.
Used for formatting ``(asctime)`` placeholder in ``prefix_fmt``.
.. versionchanged:: 3.2
Added ``fmt`` and ``datefmt`` arguments.'

def __init__(self, color=True, fmt=DEFAULT_FORMAT, datefmt=DEFAULT_DATE_FORMAT, colors=DEFAULT_COLORS):

    logging.Formatter.__init__(self, datefmt=datefmt)
    self._fmt = fmt
    self._colors = {}
    if (color and _stderr_supports_color()):
        fg_color = (curses.tigetstr('setaf') or curses.tigetstr('setf') or '')
        if ((3, 0) < sys.version_info < (3, 2, 3)):
            fg_color = unicode_type(fg_color, 'ascii')
        for (levelno, code) in colors.items():
            self._colors[levelno] = unicode_type(curses.tparm(fg_color, code), 'ascii')
        self._normal = unicode_type(curses.tigetstr('sgr0'), 'ascii')
    else:
        self._normal = ''
