MCPcopy Index your code
hub / github.com/RustPython/RustPython / getLevelName

Function getLevelName

Lib/logging/__init__.py:129–154  ·  view source on GitHub ↗

Return the textual or numeric representation of logging level 'level'. If the level is one of the predefined levels (CRITICAL, ERROR, WARNING, INFO, DEBUG) then you get the corresponding string. If you have associated levels with names using addLevelName then the name you have

(level)

Source from the content-addressed store, hash-verified

127 return _nameToLevel.copy()
128
129def getLevelName(level):
130 """
131 Return the textual or numeric representation of logging level 'level'.
132
133 If the level is one of the predefined levels (CRITICAL, ERROR, WARNING,
134 INFO, DEBUG) then you get the corresponding string. If you have
135 associated levels with names using addLevelName then the name you have
136 associated with 'level' is returned.
137
138 If a numeric value corresponding to one of the defined levels is passed
139 in, the corresponding string representation is returned.
140
141 If a string representation of the level is passed in, the corresponding
142 numeric value is returned.
143
144 If no matching numeric or string value is passed in, the string
145 'Level %s' % level is returned.
146 """
147 # See Issues #22386, #27937 and #29220 for why it's this way
148 result = _levelToName.get(level)
149 if result is not None:
150 return result
151 result = _nameToLevel.get(level)
152 if result is not None:
153 return result
154 return "Level %s" % level
155
156def addLevelName(level, levelName):
157 """

Callers 6

__init__Method · 0.85
__repr__Method · 0.85
__repr__Method · 0.85
__repr__Method · 0.85
__repr__Method · 0.85
__repr__Method · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected