def __init__(self,
                 fmt='%(color)s[%(fixed_levelname)s %(asctime)s %(module)s:%(lineno)d]%(end_color)s %(message)s',
                 datefmt='%Y-%m-%d %H:%M:%S',
                 color=False,
                 tab='  '):
        """
        a log is constituted by two part: prefix + content

        prefix is determined by `prefixfmt`, whose color depends on logging level

        content is what passed to the log method, %(message)s by default
        """
        # as origin __init__ function is very simple
        # (just store two attributes on self: _fmt & datefmt), execute it firstly
        logging.Formatter.__init__(self, datefmt=datefmt)

        self.fmt = fmt
        self.ufmt = decode_(fmt, 'utf8')
        self.color = color
        self.tab = tab
def __init__ ( self , fmt = '%(color)s[%(fixed_levelname)s %(asctime)s %(module)s:%(lineno)d]%(end_color)s %(message)s' , datefmt = '%Y-%m-%d %H:%M:%S' , color = False , tab = '  ' ) : logging . Formatter . __init__ ( self , datefmt = datefmt ) self . fmt = fmt self . ufmt = decode_ ( fmt , 'utf8' ) self . color = color self . tab = tab
a log is constituted by two part: prefix + content

        prefix is determined by `prefixfmt`, whose color depends on logging level

        content is what passed to the log method, %(message)s by default