Example #1
0
File: log.py Project: ja11sop/cuppa
    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 )
Example #2
0
    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)
Example #3
0
 def critical_fmt( cls ):
     return "{} %(message)s".format( as_error_label( as_emphasised( "%(name)s: %(module)s: [%(levelname)s]") ) )
Example #4
0
 def error_fmt( cls ):
     return "{} %(message)s".format( as_error_label("%(name)s: %(module)s: [%(levelname)s]") )