[New-bugs-announce] [issue12637] logging lastResort handler not ignoring messages less than WARNING

Xavier de Gaye report at bugs.python.org
Mon Jul 25 13:04:21 CEST 2011


New submission from Xavier de Gaye <xdegaye at gmail.com>:

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')
>>>

----------
components: Library (Lib)
files: logging_lastResort.patch
keywords: patch
messages: 141085
nosy: xdegaye
priority: normal
severity: normal
status: open
title: logging lastResort handler not ignoring messages less than WARNING
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file22748/logging_lastResort.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12637>
_______________________________________


More information about the New-bugs-announce mailing list