LogLevels
LogLevels wrapper
- class DIRAC.FrameworkSystem.private.standardLogging.LogLevels.LogLevel(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
IntEnum
- ALWAYS = 45
- DEBUG = 10
- ERROR = 40
- FATAL = 50
- INFO = 20
- NOTICE = 35
- VERBOSE = 15
- WARN = 30
- class DIRAC.FrameworkSystem.private.standardLogging.LogLevels.LogLevels
Bases:
object
Wrapper of the old LogLevels class. LogLevels is used to integrate custom levels to logging: verbose, notice and always.
It is useful to make conversion string-integer. In fact, logging use only integers while the oldgLogger used strings, so we need a converter. Example: log.setLevel(logging.ALWAYS) in ‘logging’ become log.setLevel(“always”) in gLogger. We keep the string form because there are many and many calls with string levels.
There is a method named getLevelName in ‘logging’ which could do almost the same job, but with logging, we can not return all level names in one time and the method getLevelName does not return errors or None values when a level does not exist. So at the moment, the LogLevels class is useful.
- ALWAYS = 45
- DEBUG = 10
- ERROR = 40
- FATAL = 50
- INFO = 20
- NOTICE = 35
- VERBOSE = 15
- WARN = 30
- classmethod getLevel(level)
Get a level name from a level value. We could use logging.getLevelName() to get the level value but it is less simple.
- Parameters:
level (int) – level value
- Returns:
a level name according to a level value
- classmethod getLevelNames()
- Returns:
all level names available in the wrapper
- classmethod getLevelValue(sName)
Get a level value from a level name. We could use logging.getLevelName() to get the level value but it is less simple.
- Parameters:
sName (str) – level name
- Returns:
a level value according to a level name
- classmethod getLevels()
- Returns:
the level dictionary. Must no be redefined