diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-03-29 09:05:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-29 09:05:29 (GMT) |
commit | 473fd7bbf0508074f28f020801c207a8d379637b (patch) | |
tree | 999f4ca1bde7ae7c0e561c8fc371505b867894f0 | |
parent | 5ae5ea8375b6ad1fad1fa4c529980ee245250c70 (diff) | |
download | cpython-473fd7bbf0508074f28f020801c207a8d379637b.zip cpython-473fd7bbf0508074f28f020801c207a8d379637b.tar.gz cpython-473fd7bbf0508074f28f020801c207a8d379637b.tar.bz2 |
[3.10] gh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (GH-102635) (GH-103107)
(cherry picked from commit d835b3f05de7e2d800138e5969eeb9656b0ed860)
Co-authored-by: Matěj Cepl <mcepl@cepl.eu>
-rw-r--r-- | Doc/howto/logging-cookbook.rst | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/Doc/howto/logging-cookbook.rst b/Doc/howto/logging-cookbook.rst index 1272ea1..ee1471a 100644 --- a/Doc/howto/logging-cookbook.rst +++ b/Doc/howto/logging-cookbook.rst @@ -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 |