mirror of https://github.com/python/cpython
Fixes #27937: optimise code used in all logging calls.
This commit is contained in:
parent
6e025608a2
commit
0a7b7e30ff
|
@ -130,8 +130,9 @@ def getLevelName(level):
|
|||
|
||||
Otherwise, the string "Level %s" % level is returned.
|
||||
"""
|
||||
# See Issue #22386 for the reason for this convoluted expression
|
||||
return _levelToName.get(level, _nameToLevel.get(level, ("Level %s" % level)))
|
||||
# See Issues #22386 and #27937 for why it's this way
|
||||
return (_levelToName.get(level) or _nameToLevel.get(level) or
|
||||
"Level %s" % level)
|
||||
|
||||
def addLevelName(level, levelName):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue