- class DIRAC.FrameworkSystem.private.standardLogging.LogLevels.LogLevels
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.
level (int) – level value
a level name according to a level value
- classmethod getLevelNames()
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.
sName (str) – level name
a level value according to a level name
- classmethod getLevels()
the level dictionary. Must no be redefined