From 97d6ce4ca3ee07782a61b868820d7048d455384f Mon Sep 17 00:00:00 2001 From: Vinay Sajip Date: Sat, 31 Dec 2016 11:40:11 +0000 Subject: Closes #28524: added default level for logging.disable(). --- Lib/logging/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/logging/__init__.py') diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 2590d6528f..d886d35c12 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -1889,7 +1889,7 @@ def log(level, msg, *args, **kwargs): basicConfig() root.log(level, msg, *args, **kwargs) -def disable(level): +def disable(level=CRITICAL): """ Disable all logging calls of severity 'level' and below. """ -- cgit v1.2.1 From d58327d81a616ff39c01cd3bdee95c1309826d52 Mon Sep 17 00:00:00 2001 From: Vinay Sajip Date: Wed, 11 Jan 2017 06:57:55 +0000 Subject: Closes #29220: Fixed regression in logging.getLevelName(). --- Lib/logging/__init__.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Lib/logging/__init__.py') diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index d886d35c12..fb866f39d9 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -131,9 +131,13 @@ def getLevelName(level): Otherwise, the string "Level %s" % level is returned. """ - # See Issues #22386 and #27937 for why it's this way - return (_levelToName.get(level) or _nameToLevel.get(level) or - "Level %s" % level) + # See Issues #22386, #27937 and #29220 for why it's this way + result = _levelToName.get(level) + if result is None: + result = _nameToLevel.get(level) + if result is None: + result = "Level %s" % level + return result def addLevelName(level, levelName): """ -- cgit v1.2.1