summaryrefslogtreecommitdiffstats
path: root/Lib/logging
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-09-22 03:26:37 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2019-09-22 03:26:37 (GMT)
commitfe9089a08b6dd6dd1ba8b238afc2fc4dfaac689e (patch)
tree183c2a478f2baf2f72a2a622fb86a4b5e64cd36f /Lib/logging
parent24231ca75c721c8167a7394deb300727ccdcba51 (diff)
downloadcpython-fe9089a08b6dd6dd1ba8b238afc2fc4dfaac689e.zip
cpython-fe9089a08b6dd6dd1ba8b238afc2fc4dfaac689e.tar.gz
cpython-fe9089a08b6dd6dd1ba8b238afc2fc4dfaac689e.tar.bz2
Updated incorrect level-setting code to use setLevel(). (GH-16325) (GH-16327)
(cherry picked from commit 1d094af716e8ce5e5710e1dfbce7832ba333be55)
Diffstat (limited to 'Lib/logging')
-rw-r--r--Lib/logging/config.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/logging/config.py b/Lib/logging/config.py
index cfd9311..9dd35e1 100644
--- a/Lib/logging/config.py
+++ b/Lib/logging/config.py
@@ -1,4 +1,4 @@
-# Copyright 2001-2016 by Vinay Sajip. All Rights Reserved.
+# Copyright 2001-2019 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
@@ -19,7 +19,7 @@ Configuration functions for the logging package for Python. The core package
is based on PEP 282 and comments thereto in comp.lang.python, and influenced
by Apache's log4j system.
-Copyright (C) 2001-2016 Vinay Sajip. All Rights Reserved.
+Copyright (C) 2001-2019 Vinay Sajip. All Rights Reserved.
To use, simply 'import logging' and log away!
"""
@@ -173,9 +173,10 @@ def _handle_existing_loggers(existing, child_loggers, disable_existing):
for log in existing:
logger = root.manager.loggerDict[log]
if log in child_loggers:
- logger.level = logging.NOTSET
- logger.handlers = []
- logger.propagate = True
+ if not isinstance(logger, logging.PlaceHolder):
+ logger.setLevel(logging.NOTSET)
+ logger.handlers = []
+ logger.propagate = True
else:
logger.disabled = disable_existing