[docs] [issue35821] Clarify when logging events are propagated when propagate is true

Vinay Sajip report at bugs.python.org
Tue Jan 29 02:41:18 EST 2019


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:

> I'm not sure which part of what I wrote you think is inaccurate.

It's just that language can be tricky. When you said "pass to the parent logger" this might be misconstrued as some kind of call to a method of the parent logger.

Your OP says that you think "logged to this logger" means (2), but actually it means (1). Expanding with examples:

If the propagate attribute of the logger named A.B.C evaluates to true, any event logged to A.B.C via a method call such as logging.getLogger('A.B.C').error(...) will [subject to passing that logger's level and filter settings] be passed in turn to any handlers attached to loggers named A.B, A and the root logger, after first being passed to any handlers attached to A.B.C. If any logger in the chain A.B.C, A.B, A has its propagate attribute set to false, then that is the last logger whose handlers are offered the event to handle, and propagation stops at that point.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35821>
_______________________________________


More information about the docs mailing list