-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-41906: Accept built filters in dictConfig #30756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly stylistic points. Thanks!
Doc/library/logging.config.rst
Outdated
@@ -126,6 +126,10 @@ in :mod:`logging` itself) and defining handlers which are declared either in | |||
.. versionadded:: 3.10 | |||
The *encoding* parameter is added. | |||
|
|||
.. versionadded:: 3.11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is in the wrong place (fileConfig
rather than dictConfig
) and in any case should perhaps be in the documentation on the details of the dictionary schema, in the filters
bullet point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed 🤦 .
I've added it to the section of user custom objects, have a look and let me know if you think it fits there.
Should we also add it to both the handlers and loggers section?
Misc/NEWS.d/next/Library/2022-01-21-18-19-45.bpo-41906.YBaquj.rst
Outdated
Show resolved
Hide resolved
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
54cf7ed
to
d3c975a
Compare
Thanks for the review! I have made the requested changes; please review again See https://github.com/python/cpython/compare/54cf7ed267b2e47107995509b0e370733da54306..d3c975a91f42c509bea10476367efc9f72416936, let me know how you want the docs to appear and I will send another push changing that. |
Thanks for making the requested changes! @vsajip: please review the changes made to this pull request. |
Doc/library/logging.config.rst
Outdated
@@ -524,6 +524,10 @@ valid keyword parameter name, and so will not clash with the names of | |||
the keyword arguments used in the call. The ``'()'`` also serves as a | |||
mnemonic that the corresponding value is a callable. | |||
|
|||
.. versionadded:: 3.11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added it to the section of user custom objects, have a look and let me know if you think it fits there.
Should we also add it to both the handlers and loggers section?
Yes, it does belong here, but on reflection I think it should be a versionchanged
rather than versionadded
and this should also be in the bullets of handlers
and loggers
in the "Dictionary Schema Details" section where it currently says that filters
are "A list of ids of the filters for this handler".
Doc/library/logging.config.rst
Outdated
@@ -524,6 +524,10 @@ valid keyword parameter name, and so will not clash with the names of | |||
the keyword arguments used in the call. The ``'()'`` also serves as a | |||
mnemonic that the corresponding value is a callable. | |||
|
|||
.. versionadded:: 3.11 | |||
The ``filters`` member of ``handlers`` and ``loggers`` can take | |||
filter instances in addition of ids. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change "in addition of ids" to "in addition to ids."
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
When configuring the logging stack, accept already built filters (or just callables) in the filters array of loggers and handlers. This facilitates passing quick callables as filters.
d3c975a
to
fd7a4e1
Compare
I have made the requested changes; please review again |
Thanks for making the requested changes! @vsajip: please review the changes made to this pull request. |
When configuring the logging stack, accept already built filters (or
just callables) in the filters array of loggers and handlers.
This facilitates passing quick callables as filters.
https://bugs.python.org/issue41906
Automerge-Triggered-By: GH:vsajip