From: Vinay Sajip Date: Sun, 30 Jul 2017 19:15:18 +0000 (+0100) Subject: Updated LoggerAdapter.isEnabledFor to take advantage of caching. (GH-2951) X-Git-Tag: v3.7.0a1~337 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=75f0b5dbac3376a3b36c943ec867c0daed35eb4f;p=thirdparty%2FPython%2Fcpython.git Updated LoggerAdapter.isEnabledFor to take advantage of caching. (GH-2951) --- diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 54d4e883d973..83db82733808 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): """