summaryrefslogtreecommitdiffstats
path: root/Lib/logging
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2010-09-20 10:13:13 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2010-09-20 10:13:13 (GMT)
commit61c3f0dae732589b11f4a1a2cb26173fe0fb5983 (patch)
treea17def55012ad4ce8a49c5946936c5734764b4a5 /Lib/logging
parentbb14d4bc173559dced0f69fb0b8a43a0594f75f8 (diff)
downloadcpython-61c3f0dae732589b11f4a1a2cb26173fe0fb5983.zip
cpython-61c3f0dae732589b11f4a1a2cb26173fe0fb5983.tar.gz
cpython-61c3f0dae732589b11f4a1a2cb26173fe0fb5983.tar.bz2
logging: added hasHandlers() to LoggerAdapter.
Diffstat (limited to 'Lib/logging')
-rw-r--r--Lib/logging/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 134d923..42b957c 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -1439,6 +1439,12 @@ class LoggerAdapter(object):
"""
return self.logger.isEnabledFor(level)
+ def hasHandlers(self):
+ """
+ See if the underlying logger has any handlers.
+ """
+ return self.logger.hasHandlers()
+
root = RootLogger(WARNING)
Logger.root = root
Logger.manager = Manager(Logger.root)