Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-92592: Allow logging filters to return a LogRecord. (GH-92591)#92591

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vsajip merged 18 commits intopython:mainfromadriangb:logging-filters
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
18 commits
Select commitHold shift + click to select a range
3aeeba6
allow logging filters to return a LogRecord
adriangbMay 10, 2022
1e4d27f
edit docstring
adriangbMay 10, 2022
b526a35
remove unecessary __bool__ impl
adriangbMay 10, 2022
f1ea183
edit docs
adriangbMay 10, 2022
19561d3
Add docs and blurb
adriangbMay 10, 2022
14e704d
Merge branch 'main' into logging-filters
adriangbMay 10, 2022
4d34540
fix rst
adriangbMay 10, 2022
a69e76a
touch up wording
adriangbMay 10, 2022
67453f6
add test for filters on loggers
adriangbMay 10, 2022
b1e1084
push straggler change
adriangbMay 10, 2022
f72c594
Merge branch 'main' into logging-filters
adriangbMay 10, 2022
225329f
pr feedback
adriangbMay 10, 2022
735d78a
Merge branch 'logging-filters' of https://github.com/adriangb/cpython…
adriangbMay 10, 2022
5e54c77
Merge branch 'main' into logging-filters
adriangbMay 10, 2022
f52e404
fix whitespace
adriangbMay 10, 2022
46e2f7f
fix docs as per pr feedback
adriangbMay 10, 2022
7a0f470
Update logging-cookbook.rst
vsajipJun 7, 2022
643551d
Update logging.rst
vsajipJun 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
fix docs as per pr feedback
  • Loading branch information
@adriangb
adriangb committedMay 10, 2022
commit46e2f7fbeeae2c124980c58efb453836eaa214d5
6 changes: 3 additions & 3 deletionsDoc/library/logging.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -665,7 +665,7 @@ empty string, all events are passed.
Is the specified record to be logged? Returns falsy for no, truthy for
yes. Filters can either modify log records in-place or return a completely
different record instance which will replace the original
log recordwithout modifying it.
log recordin any future processing of the event.

Note that filters attached to handlers are consulted before an event is
emitted by the handler, whereas filters attached to loggers are consulted
Expand All@@ -689,8 +689,8 @@ which has a ``filter`` method with the same semantics.

.. versionchanged:: 3.12
You can now return a :class:`LogRecord` instance from filters to replace
the log recordwithout modifying it in place. This allows filters attached to
ona :class:`Handler` to modify the log record before it is emitted without
the log recordrather than modifying it in place. This allows filters attached to
a :class:`Handler` to modify the log record before it is emitted without
having side effects on other handlers.

Although filters are used primarily to filter records based on more
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
Let :mod:`logging` filters to return a :class:`logging.LogRecord` instance
Allow :mod:`logging` filters to return a :class:`logging.LogRecord` instance
so that filters attached to :class:`logging.Handler`\ s can enrich records without
side effects on other handlers.

[8]ページ先頭

©2009-2025 Movatter.jp