Skip to content

Commit cc2cf85

Browse files
vsajipAlexWaygood
andauthored
gh-107877: Update logging levels reference table with usage criteria. (#107894)
Co-authored-by: Alex Waygood <[email protected]>
1 parent 2b6dc2a commit cc2cf85

File tree

1 file changed

+33
-15
lines changed

1 file changed

+33
-15
lines changed

Doc/library/logging.rst

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -397,21 +397,39 @@ have specific values relative to the predefined levels. If you define a level
397397
with the same numeric value, it overwrites the predefined value; the predefined
398398
name is lost.
399399

400-
+-----------------------+---------------+
401-
| Level | Numeric value |
402-
+=======================+===============+
403-
| .. py:data:: CRITICAL | 50 |
404-
+-----------------------+---------------+
405-
| .. py:data:: ERROR | 40 |
406-
+-----------------------+---------------+
407-
| .. py:data:: WARNING | 30 |
408-
+-----------------------+---------------+
409-
| .. py:data:: INFO | 20 |
410-
+-----------------------+---------------+
411-
| .. py:data:: DEBUG | 10 |
412-
+-----------------------+---------------+
413-
| .. py:data:: NOTSET | 0 |
414-
+-----------------------+---------------+
400+
+-----------------------+---------------+-------------------------------------+
401+
| Level | Numeric value | What it means / When to use it |
402+
+=======================+===============+=====================================+
403+
| .. py:data:: NOTSET | 0 | When set on a logger, indicates that|
404+
| | | ancestor loggers are to be consulted|
405+
| | | to determine the effective level. |
406+
| | | If that still resolves to |
407+
| | | :const:`!NOTSET`, then all events |
408+
| | | are logged. When set on a handler, |
409+
| | | all events are handled. |
410+
+-----------------------+---------------+-------------------------------------+
411+
| .. py:data:: DEBUG | 10 | Detailed information, typically only|
412+
| | | of interest to a developer trying to|
413+
| | | diagnose a problem. |
414+
+-----------------------+---------------+-------------------------------------+
415+
| .. py:data:: INFO | 20 | Confirmation that things are working|
416+
| | | as expected. |
417+
+-----------------------+---------------+-------------------------------------+
418+
| .. py:data:: WARNING | 30 | An indication that something |
419+
| | | unexpected happened, or that a |
420+
| | | problem might occur in the near |
421+
| | | future (e.g. 'disk space low'). The |
422+
| | | software is still working as |
423+
| | | expected. |
424+
+-----------------------+---------------+-------------------------------------+
425+
| .. py:data:: ERROR | 40 | Due to a more serious problem, the |
426+
| | | software has not been able to |
427+
| | | perform some function. |
428+
+-----------------------+---------------+-------------------------------------+
429+
| .. py:data:: CRITICAL | 50 | A serious error, indicating that the|
430+
| | | program itself may be unable to |
431+
| | | continue running. |
432+
+-----------------------+---------------+-------------------------------------+
415433

416434

417435
.. _handler:

0 commit comments

Comments
 (0)