Mailing List Archive

[3.11] gh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (GH-102635) (GH-103106)
https://github.com/python/cpython/commit/d189e2db0bca60eba328cc31b86e62a1e2b3647a
commit: d189e2db0bca60eba328cc31b86e62a1e2b3647a
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
committer: vsajip <vinay_sajip@yahoo.co.uk>
date: 2023-03-29T10:04:53+01:00
summary:

[3.11] gh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (GH-102635) (GH-103106)

(cherry picked from commit d835b3f05de7e2d800138e5969eeb9656b0ed860)

Co-authored-by: Mat?j Cepl <mcepl@cepl.eu>

files:
M Doc/howto/logging-cookbook.rst

diff --git a/Doc/howto/logging-cookbook.rst b/Doc/howto/logging-cookbook.rst
index e4338ab912ae..ffb566c1e86d 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

_______________________________________________
Python-checkins mailing list
Python-checkins@python.org
https://mail.python.org/mailman/listinfo/python-checkins