MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / getLevelName

Function getLevelName

tools/python-3.11.9-amd64/Lib/logging/__init__.py:123–148  ·  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

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

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