Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 800e11b

Browse files
committed
Issue #19902: Added list of logging levels.
1 parent ccedc22 commit 800e11b

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

Doc/library/logging.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ is the module's name in the Python package namespace.
113113
If the root is reached, and it has a level of NOTSET, then all messages will be
114114
processed. Otherwise, the root's level will be used as the effective level.
115115

116+
See :ref:`levels` for a list of levels.
117+
116118
.. versionchanged:: 3.2
117119
The *lvl* parameter now accepts a string representation of the
118120
level such as 'INFO' as an alternative to the integer constants
@@ -316,6 +318,34 @@ is the module's name in the Python package namespace.
316318
.. versionadded:: 3.2
317319

318320

321+
.. _levels:
322+
323+
Logging Levels
324+
--------------
325+
326+
The numeric values of logging levels are given in the following table. These are
327+
primarily of interest if you want to define your own levels, and need them to
328+
have specific values relative to the predefined levels. If you define a level
329+
with the same numeric value, it overwrites the predefined value; the predefined
330+
name is lost.
331+
332+
+--------------+---------------+
333+
| Level | Numeric value |
334+
+==============+===============+
335+
| ``CRITICAL`` | 50 |
336+
+--------------+---------------+
337+
| ``ERROR`` | 40 |
338+
+--------------+---------------+
339+
| ``WARNING`` | 30 |
340+
+--------------+---------------+
341+
| ``INFO`` | 20 |
342+
+--------------+---------------+
343+
| ``DEBUG`` | 10 |
344+
+--------------+---------------+
345+
| ``NOTSET`` | 0 |
346+
+--------------+---------------+
347+
348+
319349
.. _handler:
320350

321351
Handler Objects
@@ -356,6 +386,8 @@ subclasses. However, the :meth:`__init__` method in subclasses needs to call
356386
severe than *lvl* will be ignored. When a handler is created, the level is set
357387
to :const:`NOTSET` (which causes all messages to be processed).
358388

389+
See :ref:`levels` for a list of levels.
390+
359391
.. versionchanged:: 3.2
360392
The *lvl* parameter now accepts a string representation of the
361393
level such as 'INFO' as an alternative to the integer constants

0 commit comments

Comments
 (0)