classification
Title: logging lastResort handler not ignoring messages less than WARNING
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.3, Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: vinay.sajip Nosy List: python-dev, vinay.sajip, xdegaye
Priority: normal Keywords: patch

Created on 2011-07-25 11:04 by xdegaye, last changed 2011-07-25 19:00 by vinay.sajip. This issue is now closed.

Files
File name Uploaded Description Edit
logging_lastResort.patch xdegaye, 2011-07-25 11:04 patch file
Messages (2)
msg141085 - (view) Author: Xavier de Gaye (xdegaye) * Date: 2011-07-25 11:04
The 'Advanced Logging Tutorial' states about the lastResort handler:
"The handler’s level is set to WARNING, so all events at this and
greater severities will be output."

Python 3.2 does not follow this behavior:

Python 3.2 (r32:88445, Jun 18 2011, 20:30:18)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>> root = logging.getLogger()
>>> root.setLevel('DEBUG')
>>> root.warning('warning msg')
warning msg
>>> root.debug('debug msg')
debug msg
>>> 

This is fixed with the attached patch:

Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>> root = logging.getLogger()
>>> root.setLevel('DEBUG')
>>> root.warning('warning msg')
warning msg
>>> root.debug('debug msg')
>>>
msg141113 - (view) Author: Roundup Robot (python-dev) Date: 2011-07-25 18:58
New changeset d11a1a373f58 by Vinay Sajip in branch '3.2':
Fixes #12637: Last resort messages now correctly handled. Thanks to Xavier de Gaye for the patch."
http://hg.python.org/cpython/rev/d11a1a373f58

New changeset de13ce98ca3b by Vinay Sajip in branch 'default':
Fixes #12637: Merged fix from 3.2 and added test.
http://hg.python.org/cpython/rev/de13ce98ca3b
History
Date User Action Args
2011-07-25 19:00:40vinay.sajipsetstatus: open -> closed
versions: + Python 3.3
nosy: + vinay.sajip

assignee: vinay.sajip
resolution: fixed
2011-07-25 18:58:21python-devsetnosy: + python-dev
messages: + msg141113
2011-07-25 11:04:21xdegayecreate