summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2011-07-25 18:53:28 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2011-07-25 18:53:28 (GMT)
commit45dedaafc2d8f83c3021df28251a4a7dae067774 (patch)
tree42b90b4960c2f2f7fc1c773a77e34465f587bdf1
parent59c01edcaa4a973e159d2ed3a5084936d3fffa18 (diff)
downloadcpython-45dedaafc2d8f83c3021df28251a4a7dae067774.zip
cpython-45dedaafc2d8f83c3021df28251a4a7dae067774.tar.gz
cpython-45dedaafc2d8f83c3021df28251a4a7dae067774.tar.bz2
Fixes #12637: Last resort messages now correctly handled. Thanks to Xavier de Gaye for the patch."
-rw-r--r--Lib/logging/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index e4b34a1..0af8bb7 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -18,7 +18,7 @@
Logging package for Python. Based on PEP 282 and comments thereto in
comp.lang.python, and influenced by Apache's log4j system.
-Copyright (C) 2001-2010 Vinay Sajip. All Rights Reserved.
+Copyright (C) 2001-2011 Vinay Sajip. All Rights Reserved.
To use, simply 'import logging' and log away!
"""
@@ -1440,7 +1440,8 @@ class Logger(Filterer):
c = c.parent
if (found == 0):
if lastResort:
- lastResort.handle(record)
+ if record.levelno >= lastResort.level:
+ lastResort.handle(record)
elif raiseExceptions and not self.manager.emittedNoHandlerWarning:
sys.stderr.write("No handlers could be found for logger"
" \"%s\"\n" % self.name)