def __init__( self, fmt=None ): if not fmt: preamble = self.preamble_from_level() fmt = self.fmt_with_preamble( preamble ) self._warn_fmt = self.fmt_with_preamble( as_warning_label( preamble ) ) self._error_fmt = self.fmt_with_preamble( as_error_label( preamble ) ) self._critical_fmt = self.fmt_with_preamble( as_error_label( as_emphasised( preamble ) ) ) logging.Formatter.__init__( self, fmt )
def __init__(self, fmt=None): if not fmt: preamble = self.preamble_from_level() fmt = self.fmt_with_preamble(preamble) self._warn_fmt = self.fmt_with_preamble(as_warning_label(preamble)) self._error_fmt = self.fmt_with_preamble(as_error_label(preamble)) self._critical_fmt = self.fmt_with_preamble( as_error_label(as_emphasised(preamble))) logging.Formatter.__init__(self, fmt)
def critical_fmt( cls ): return "{} %(message)s".format( as_error_label( as_emphasised( "%(name)s: %(module)s: [%(levelname)s]") ) )
def error_fmt( cls ): return "{} %(message)s".format( as_error_label("%(name)s: %(module)s: [%(levelname)s]") )