mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
[3.11] gh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (GH-102635) (GH-103106)
(cherry picked from commit d835b3f05d
)
Co-authored-by: Matěj Cepl <mcepl@cepl.eu>
This commit is contained in:
parent
766038d995
commit
d189e2db0b
1 changed files with 14 additions and 10 deletions
|
@ -340,10 +340,12 @@ adding a ``filters`` section parallel to ``formatters`` and ``handlers``:
|
|||
|
||||
.. code-block:: json
|
||||
|
||||
"filters": {
|
||||
"warnings_and_below": {
|
||||
"()" : "__main__.filter_maker",
|
||||
"level": "WARNING"
|
||||
{
|
||||
"filters": {
|
||||
"warnings_and_below": {
|
||||
"()" : "__main__.filter_maker",
|
||||
"level": "WARNING"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -351,12 +353,14 @@ and changing the section on the ``stdout`` handler to add it:
|
|||
|
||||
.. code-block:: json
|
||||
|
||||
"stdout": {
|
||||
"class": "logging.StreamHandler",
|
||||
"level": "INFO",
|
||||
"formatter": "simple",
|
||||
"stream": "ext://sys.stdout",
|
||||
"filters": ["warnings_and_below"]
|
||||
{
|
||||
"stdout": {
|
||||
"class": "logging.StreamHandler",
|
||||
"level": "INFO",
|
||||
"formatter": "simple",
|
||||
"stream": "ext://sys.stdout",
|
||||
"filters": ["warnings_and_below"]
|
||||
}
|
||||
}
|
||||
|
||||
A filter is just a function, so we can define the ``filter_maker`` (a factory
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue