mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Issue #6314: logging.basicConfig() performs extra checks on the "level" argument.
This commit is contained in:
parent
7f146ab0ca
commit
603fb6d667
2 changed files with 8 additions and 1 deletions
|
@ -1397,6 +1397,10 @@ def basicConfig(**kwargs):
|
|||
root.addHandler(hdlr)
|
||||
level = kwargs.get("level")
|
||||
if level is not None:
|
||||
if str(level) == level: # If a string was passed, do more checks
|
||||
if level not in _levelNames:
|
||||
raise ValueError("Unknown level: %r" % level)
|
||||
level = _levelNames[level]
|
||||
root.setLevel(level)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue