diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-09-20 10:13:13 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-09-20 10:13:13 (GMT) |
commit | 61c3f0dae732589b11f4a1a2cb26173fe0fb5983 (patch) | |
tree | a17def55012ad4ce8a49c5946936c5734764b4a5 /Lib/logging | |
parent | bb14d4bc173559dced0f69fb0b8a43a0594f75f8 (diff) | |
download | cpython-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__.py | 6 |
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) |