mirror of
https://github.com/python/cpython.git
synced 2025-11-13 15:40:05 +00:00
gh-113350: Improve the wording of python logging docs to remove an ambiguity around use of the word "higher". (GH-113491)
Co-authored-by: Wei-Hsiang (Matt) Wang <mattwang44@gmail.com>
This commit is contained in:
parent
af2b8f6845
commit
00cdd416fc
2 changed files with 6 additions and 7 deletions
|
|
@ -332,10 +332,10 @@ Suppose you configure logging with the following JSON:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
This configuration does *almost* what we want, except that ``sys.stdout`` would
|
This configuration does *almost* what we want, except that ``sys.stdout`` would show messages
|
||||||
show messages of severity ``ERROR`` and above as well as ``INFO`` and
|
of severity ``ERROR`` and only events of this severity and higher will be tracked
|
||||||
``WARNING`` messages. To prevent this, we can set up a filter which excludes
|
as well as ``INFO`` and ``WARNING`` messages. To prevent this, we can set up a filter which
|
||||||
those messages and add it to the relevant handler. This can be configured by
|
excludes those messages and add it to the relevant handler. This can be configured by
|
||||||
adding a ``filters`` section parallel to ``formatters`` and ``handlers``:
|
adding a ``filters`` section parallel to ``formatters`` and ``handlers``:
|
||||||
|
|
||||||
.. code-block:: json
|
.. code-block:: json
|
||||||
|
|
|
||||||
|
|
@ -89,9 +89,8 @@ described below (in increasing order of severity):
|
||||||
| | itself may be unable to continue running. |
|
| | itself may be unable to continue running. |
|
||||||
+--------------+---------------------------------------------+
|
+--------------+---------------------------------------------+
|
||||||
|
|
||||||
The default level is ``WARNING``, which means that only events of this level
|
The default level is ``WARNING``, which means that only events of this severity and higher
|
||||||
and above will be tracked, unless the logging package is configured to do
|
will be tracked, unless the logging package is configured to do otherwise.
|
||||||
otherwise.
|
|
||||||
|
|
||||||
Events that are tracked can be handled in different ways. The simplest way of
|
Events that are tracked can be handled in different ways. The simplest way of
|
||||||
handling tracked events is to print them to the console. Another common way
|
handling tracked events is to print them to the console. Another common way
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue