Commit 45dedaaf authored by Vinay Sajip's avatar Vinay Sajip

Fixes #12637: Last resort messages now correctly handled. Thanks to Xavier de Gaye for the patch."

parent 59c01edc
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
Logging package for Python. Based on PEP 282 and comments thereto in Logging package for Python. Based on PEP 282 and comments thereto in
comp.lang.python, and influenced by Apache's log4j system. 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! To use, simply 'import logging' and log away!
""" """
...@@ -1440,7 +1440,8 @@ class Logger(Filterer): ...@@ -1440,7 +1440,8 @@ class Logger(Filterer):
c = c.parent c = c.parent
if (found == 0): if (found == 0):
if lastResort: if lastResort:
lastResort.handle(record) if record.levelno >= lastResort.level:
lastResort.handle(record)
elif raiseExceptions and not self.manager.emittedNoHandlerWarning: elif raiseExceptions and not self.manager.emittedNoHandlerWarning:
sys.stderr.write("No handlers could be found for logger" sys.stderr.write("No handlers could be found for logger"
" \"%s\"\n" % self.name) " \"%s\"\n" % self.name)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment