diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2017-07-30 19:15:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-30 19:15:18 (GMT) |
commit | 75f0b5dbac3376a3b36c943ec867c0daed35eb4f (patch) | |
tree | 206052e2b3659909b26388af46dc486c2cea3651 | |
parent | 9397e2a87ed6e0e724ad71a0c751553620cb775e (diff) | |
download | cpython-75f0b5dbac3376a3b36c943ec867c0daed35eb4f.zip cpython-75f0b5dbac3376a3b36c943ec867c0daed35eb4f.tar.gz cpython-75f0b5dbac3376a3b36c943ec867c0daed35eb4f.tar.bz2 |
Updated LoggerAdapter.isEnabledFor to take advantage of caching. (GH-2951)
-rw-r--r-- | Lib/logging/__init__.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 54d4e88..83db827 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -1729,9 +1729,7 @@ class LoggerAdapter(object): """ 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): """ |