Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Cpython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sip
Cpython
Commits
a3d5ecba
Unverified
Commit
a3d5ecba
authored
2 years ago
by
Miss Islington (bot)
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[3.11] gh-88287: Add BufferingFormatter documentation. (GH-96608) (GH-96675)
parent
ffafa9b9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Doc/library/logging.rst
+29
-0
29 additions, 0 deletions
Doc/library/logging.rst
with
29 additions
and
0 deletions
Doc/library/logging.rst
+
29
−
0
View file @
a3d5ecba
...
...
@@ -652,6 +652,35 @@ The useful mapping keys in a :class:`LogRecord` are given in the section on
:func:`traceback.print_stack`, but with the last newline removed) as a
string. This default implementation just returns the input value.
.. class:: BufferingFormatter(linefmt=None)
A base formatter class suitable for subclassing when you want to format a
number of records. You can pass a :class:`Formatter` instance which you want
to use to format each line (that corresponds to a single record). If not
specified, the default formatter (which just outputs the event message) is
used as the line formatter.
.. method:: formatHeader(records)
Return a header for a list of *records*. The base implementation just
returns the empty string. You will need to override this method if you
want specific behaviour, e.g. to show the count of records, a title or a
separator line.
.. method:: formatFooter(records)
Return a footer for a list of *records*. The base implementation just
returns the empty string. You will need to override this method if you
want specific behaviour, e.g. to show the count of records or a separator
line.
.. method:: format(records)
Return formatted text for a list of *records*. The base implementation
just returns the empty string if there are no records; otherwise, it
returns the concatenation of the header, each record formatted with the
line formatter, and the footer.
.. _filter:
Filter Objects
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment