def getLevel( self ):
"""
A convenience wrapper around ``getEffectiveLevel()`` because the integer values for the
various logging levels are clunky and probably don't mean anything to you.
Returns:
str: the name of the effective log level for this logging object, in lowercase
(``"warning"``, ``"info"``, etc.)
"""
level = self.getEffectiveLevel()
if level == logging.CRITICAL:
return 'critical'
elif level == logging.ERROR:
return 'error'
elif level == logging.WARNING:
return 'warning'
elif level == logging.INFO:
return 'info'
elif level == logging.DEBUG:
return 'debug'
elif level == logging.NOTSET:
return 'notset'
else:
return 'unknown ({})'.format( level )
评论列表
文章目录