diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2023-03-29 08:52:53 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-29 08:52:53 (GMT) |
commit | d835b3f05de7e2d800138e5969eeb9656b0ed860 (patch) | |
tree | b98e65041d0a2299edc78c3485a5abad9145cbd0 /Doc/howto | |
parent | 60bdc16b459cf8f7b359c7f87d8ae6c5928147a4 (diff) | |
download | cpython-d835b3f05de7e2d800138e5969eeb9656b0ed860.zip cpython-d835b3f05de7e2d800138e5969eeb9656b0ed860.tar.gz cpython-d835b3f05de7e2d800138e5969eeb9656b0ed860.tar.bz2 |
gh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (GH-102635)
Diffstat (limited to 'Doc/howto')
-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 1a0afb6..6ef252d 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 |