Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
22246fdd
Commit
22246fdd
authored
Oct 20, 2010
by
Vinay Sajip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
logging: clarified Filter documentation.
parent
9450cc05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
Doc/library/logging.rst
Doc/library/logging.rst
+10
-6
No files found.
Doc/library/logging.rst
View file @
22246fdd
...
@@ -3068,14 +3068,18 @@ etc.) This means that events which have been generated by descendant loggers
...
@@ -3068,14 +3068,18 @@ etc.) This means that events which have been generated by descendant loggers
will not be filtered by a logger'
s
filter
setting
,
unless
the
filter
has
also
will not be filtered by a logger'
s
filter
setting
,
unless
the
filter
has
also
been
applied
to
those
descendant
loggers
.
been
applied
to
those
descendant
loggers
.
You
don
't actually need to subclass ``Filter``: you can pass any instance
which has a ``filter`` method with the same semantics.
.. versionchanged:: 3.2
.. versionchanged:: 3.2
You
don
't need to create specialized ``Filter`` classes: you can use a plain
You don'
t
need
to
create
specialized
``
Filter
``
classes
,
or
use
other
classes
function (or other callable) as a filter. The filtering logic will check to
with
a
``
filter
``
method
:
you
can
use
a
function
(
or
other
callable
)
as
a
see if the filter object has a ``filter`` attribute: if it does, it'
s
assumed
filter
.
The
filtering
logic
will
check
to
see
if
the
filter
object
has
a
to
be
a
``
Filter
``
and
its
:
meth
:`~
Filter
.
filter
`
method
is
called
.
Otherwise
,
``
filter
``
attribute
:
if
it
does
,
it
's assumed to be a ``Filter`` and its
it
's assumed to be a callable and called with the record as the single
:meth:`~Filter.filter` method is called. Otherwise, it'
s
assumed
to
be
a
parameter. The result should conform to that of :meth:`~Filter.filter`.
callable
and
called
with
the
record
as
the
single
parameter
.
The
returned
value
should
conform
to
that
returned
by
:
meth
:`~
Filter
.
filter
`.
Other
uses
for
filters
Other
uses
for
filters
^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment