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

2021-12-07 Thread miss-islington


miss-islington  added the comment:


New changeset db42809d299d1bc3a07b29fabe8f74fa02a7e59e by Miss Islington (bot) 
in branch '3.9':
bpo-35821: Fix restructuredtext code formatting in logging.rst (GH-29963)
https://github.com/python/cpython/commit/db42809d299d1bc3a07b29fabe8f74fa02a7e59e


--

___
Python tracker 

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



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

2021-12-07 Thread miss-islington


miss-islington  added the comment:


New changeset 14f03ce6e8a33cc8b45f11c4d428193fc7c4a145 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-35821: Fix restructuredtext code formatting in logging.rst 
(GH-29963) (GH-29965)
https://github.com/python/cpython/commit/14f03ce6e8a33cc8b45f11c4d428193fc7c4a145


--

___
Python tracker 

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



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

2021-12-07 Thread Ken Jin


Ken Jin  added the comment:


New changeset c7e7a4b969b5728d4b4f3c59bf98e1e830d5c6d6 by Ken Jin in branch 
'main':
bpo-35821: Fix restructuredtext code formatting in logging.rst (GH-29963)
https://github.com/python/cpython/commit/c7e7a4b969b5728d4b4f3c59bf98e1e830d5c6d6


--

___
Python tracker 

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



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

2021-12-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28191
pull_request: https://github.com/python/cpython/pull/29966

___
Python tracker 

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



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

2021-12-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28190
pull_request: https://github.com/python/cpython/pull/29965

___
Python tracker 

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



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

2021-12-07 Thread Ken Jin


Change by Ken Jin :


--
nosy: +kj
nosy_count: 5.0 -> 6.0
pull_requests: +28188
pull_request: https://github.com/python/cpython/pull/29963

___
Python tracker 

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



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

2021-12-07 Thread Vinay Sajip


Change by Vinay Sajip :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



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

2021-12-07 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset e688568cdfe758a2316ecaf0c8df868d5dde0d83 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-35821: Add an example to Logger.propagate documentation. (GH-29841) 
(GH-29958)
https://github.com/python/cpython/commit/e688568cdfe758a2316ecaf0c8df868d5dde0d83


--

___
Python tracker 

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



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

2021-12-07 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset f78c229b4ec8621a9b15c6396b6c91518e8975d6 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-35821: Add an example to Logger.propagate documentation. (GH-29841) 
(GH-29957)
https://github.com/python/cpython/commit/f78c229b4ec8621a9b15c6396b6c91518e8975d6


--

___
Python tracker 

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



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

2021-12-07 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 2bf551757e0a7e3cc6ce2ebed2178b82438ac6b5 by Vinay Sajip in branch 
'main':
bpo-35821: Add an example to Logger.propagate documentation. (GH-29841)
https://github.com/python/cpython/commit/2bf551757e0a7e3cc6ce2ebed2178b82438ac6b5


--

___
Python tracker 

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



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

2021-12-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28182
pull_request: https://github.com/python/cpython/pull/29958

___
Python tracker 

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



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

2021-12-07 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +28181
pull_request: https://github.com/python/cpython/pull/29957

___
Python tracker 

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



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

2021-11-29 Thread Vinay Sajip


Change by Vinay Sajip :


--
keywords: +patch
pull_requests: +28070
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/29841

___
Python tracker 

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



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

2019-01-28 Thread Vinay Sajip


Vinay Sajip  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 

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



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

2019-01-25 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

I'm not sure which part of what I wrote you think is inaccurate. All of what 
you wrote matches what I was trying to convey.

For example, my saying "pass to the parent logger" corresponds to the "set 
current logger to parent" box in the diagram. And by "handled by the parent 
logger's handlers" I meant "directly offered to any handlers attached to 
ancestor loggers." And "only the propagate attribute determines whether the 
event is passed" matches your "until a logger is encountered where propagate is 
false."

--

___
Python tracker 

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



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

2019-01-25 Thread Vinay Sajip


Vinay Sajip  added the comment:

That isn't quite accurate. A logger's attached handlers will always be offered 
a chance to handle an event if the logger's level and filters allow. However, 
the event is not actually passed to ancestor loggers - it is directly offered 
to any handlers attached to ancestor loggers, until a logger is encountered 
where propagate is false - and that is the last logger whose handlers are 
offered the event. All handlers have their own levels and filters and may or 
may not process an event according to those levels and filters.

--

___
Python tracker 

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



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

2019-01-24 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

Thanks for the diagram. How about the following as a replacement?

"If this attribute is true and the event isn't rejected by the logger's level 
and filters, an event passed to this logger will recursively be passed to its 
parent logger and handled by the parent logger's handlers (after being handled 
by the original logger's handlers). The logger level and filters only come into 
play for the very first logger in this chain. For subsequent loggers, only the 
propagate attribute determines whether the event is passed to the parent."

--

___
Python tracker 

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



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

2019-01-24 Thread Vinay Sajip


Vinay Sajip  added the comment:

I believe the information is clear from this link in the documentation:

https://docs.python.org/3/howto/logging.html#logging-flow

However, if you can suggest alternative wording which you think is clearer, 
I'll certainly take a look at it. Perhaps a link could be added to this section 
from the logging.Logger.propagate section.

--

___
Python tracker 

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



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

2019-01-24 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

Also, does "logged to this logger" include events propagated to it from a child 
logger? For example, if an event is logged to logger "A.B.C" and propagated to 
"A.B", will the propagate attribute of the latter effect whether logger "A" (or 
its handlers) sees it?

--

___
Python tracker 

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



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

2019-01-24 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +vinay.sajip, xtreak

___
Python tracker 

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



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

2019-01-24 Thread Chris Jerdonek


New submission from Chris Jerdonek :

Currently, the logging docs are a bit ambiguous or at least not completely 
clear as to when events are propagated when Logger.propagate is true. The docs 
currently say [1]--

"If [the `propagate`] attribute evaluates to true, events logged to this logger 
will be passed to the handlers of higher level (ancestor) loggers, in addition 
to any handlers attached to this logger."

But it's not clear if "logged to this logger" means (1) a log method like 
info() or error() was called on the logger, or (2) the event was passed to the 
logger's handlers (i.e. satisfied the logger's log level threshold and any 
filters).

Empirically, I found that the meaning is (2).

[1]: https://docs.python.org/3/library/logging.html#logging.Logger.propagate

--
assignee: docs@python
components: Documentation
messages: 334320
nosy: chris.jerdonek, docs@python
priority: normal
severity: normal
stage: needs patch
status: open
title: Clarify when logging events are propagated when propagate is true
type: enhancement
versions: Python 3.7

___
Python tracker 

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