[Python-checkins] Updated LoggerAdapter.isEnabledFor to take advantage of caching. (GH-2951)
Vinay Sajip
webhook-mailer at python.org
Sun Jul 30 15:15:21 EDT 2017
https://github.com/python/cpython/commit/75f0b5dbac3376a3b36c943ec867c0daed35eb4f
commit: 75f0b5dbac3376a3b36c943ec867c0daed35eb4f
branch: master
author: Vinay Sajip <vinay_sajip at yahoo.co.uk>
committer: GitHub <noreply at github.com>
date: 2017-07-30T20:15:18+01:00
summary:
Updated LoggerAdapter.isEnabledFor to take advantage of caching. (GH-2951)
files:
M Lib/logging/__init__.py
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 54d4e883d97..83db8273380 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -1729,9 +1729,7 @@ def isEnabledFor(self, level):
"""
Is this logger enabled for level 'level'?
"""
- if self.logger.manager.disable >= level:
- return False
- return level >= self.getEffectiveLevel()
+ return self.logger.isEnabledFor(level)
def setLevel(self, level):
"""
More information about the Python-checkins
mailing list