]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (GH-102635)
authorMatěj Cepl <mcepl@cepl.eu>
Wed, 29 Mar 2023 08:52:53 +0000 (10:52 +0200)
committerGitHub <noreply@github.com>
Wed, 29 Mar 2023 08:52:53 +0000 (09:52 +0100)
Doc/howto/logging-cookbook.rst

index 1a0afb6940dab982bff06bf325ec51d37dae0452..6ef252d709e73562d4d9606d7cade8290e72958a 100644 (file)
@@ -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