示例#1
0
文件: log.py 项目: 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 )
示例#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)
示例#3
0
 def critical_fmt( cls ):
     return "{} %(message)s".format( as_error_label( as_emphasised( "%(name)s: %(module)s: [%(levelname)s]") ) )
示例#4
0
 def error_fmt( cls ):
     return "{} %(message)s".format( as_error_label("%(name)s: %(module)s: [%(levelname)s]") )