[issue8327] unintuitive behaviour of logging message propagation

2010-04-07 Thread Pascal Chambon

Pascal Chambon  added the comment:

Thanks for the doc patch, if you don't mind I'd just add the paragraph below 
too, to clarify the fact that logger levels are only "entry points" levels, 
ignored he rest of the time. There might be slight redundancies with the rest 
of the (long) documentation, but it's all benefit imo. B-)

"In addition to any handlers directly associated with a logger, *all handlers 
associated with all ancestors of the logger* are called to dispatch the message 
(unless the *propagate* flag for a logger is set to a false value, at which 
point the passing to ancestor handlers stops).

Note that in this process, the level of ancestor loggers is never considered : 
only their *propagate* attribute and the levels of their loggers canimpact the 
treatment on the message being dispatched. The level of a logger is thus only 
acting as an *entry point barrier*, only able to stop the whole dispatch of a 
message that enters the system through it."

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8327] unintuitive behaviour of logging message propagation

2010-04-06 Thread Vinay Sajip

Vinay Sajip  added the comment:

Documentation updated (r79876).

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8327] unintuitive behaviour of logging message propagation

2010-04-06 Thread Vinay Sajip

Vinay Sajip  added the comment:

Please see the following link for a rationale of the logging package's design:

http://plumberjack.blogspot.com/2009/09/python-logging-101.html

No patch to the logging system's code is planned, as it is working according to 
its design. The documentation will be gradually attended to as time allows, and 
patches will be considered.

--
assignee:  -> vinay.sajip
components: +Documentation -Library (Lib)
nosy: +vinay.sajip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8327] unintuitive behaviour of logging message propagation

2010-04-06 Thread Eric Smith

Changes by Eric Smith :


--
nosy: +eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8327] unintuitive behaviour of logging message propagation

2010-04-06 Thread Pascal Chambon

New submission from Pascal Chambon :

Hello

Crawling into the logging module, I've just discovered its behaviour was 
actually far from the one I expected, in a consequent gap that the 
documentation had left.

I thought that depending on the "propagate" parameter of each logger, a message 
would always try to propagate up the logger hierarchy, and that if that message 
matched the level of a logger (as well as the global disable() level), then 
this message would be tested against each handler of that logger.

But it's not at all the way it is : actually, only the level of the "entrance" 
logger is checked ; if the message is blocked by it, it's the end, parent 
loggers will never hear about it (even thoiugh they might have a lower level 
set). On the contrary, if that entrance logger accepts the message, then ALL 
handlers from the hierarchy are snet the message, without caring about the own 
level of their related logger.

That's really not the behaviour I would have expected, considering the 
global_disable > logger_level > handler_level precedence that the doc 
implicitly showed. Are there rationales behind this that I'm lacking ?

So I'd advocate either (if possible) a patching of the logging system, to 
reflect that semantic ; or the adding of comprehensive paragraphs to teh doc, 
to explain what the exact relationship between levels and propagation 
attribuets are.
Just tell me if a patch is conceivable B-)

--
components: Library (Lib)
messages: 102477
nosy: pakal
severity: normal
status: open
title: unintuitive behaviour of logging message propagation
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com