diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2013-12-19 11:50:24 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2013-12-19 11:50:24 (GMT) |
commit | 800e11b4065185e8b6ccbd4ad15134c0a885b7e7 (patch) | |
tree | bc2cf1cfc5c855ea52bb68caef51b2f5ee5ac63e /Doc/library | |
parent | ccedc2276950c3a94468e47b40ec4c9246c65a96 (diff) | |
download | cpython-800e11b4065185e8b6ccbd4ad15134c0a885b7e7.zip cpython-800e11b4065185e8b6ccbd4ad15134c0a885b7e7.tar.gz cpython-800e11b4065185e8b6ccbd4ad15134c0a885b7e7.tar.bz2 |
Issue #19902: Added list of logging levels.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/logging.rst | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index 29e9617..548428e 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -113,6 +113,8 @@ is the module's name in the Python package namespace. If the root is reached, and it has a level of NOTSET, then all messages will be processed. Otherwise, the root's level will be used as the effective level. + See :ref:`levels` for a list of levels. + .. versionchanged:: 3.2 The *lvl* parameter now accepts a string representation of the 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. .. versionadded:: 3.2 +.. _levels: + +Logging Levels +-------------- + +The numeric values of logging levels are given in the following table. These are +primarily of interest if you want to define your own levels, and need them to +have specific values relative to the predefined levels. If you define a level +with the same numeric value, it overwrites the predefined value; the predefined +name is lost. + ++--------------+---------------+ +| Level | Numeric value | ++==============+===============+ +| ``CRITICAL`` | 50 | ++--------------+---------------+ +| ``ERROR`` | 40 | ++--------------+---------------+ +| ``WARNING`` | 30 | ++--------------+---------------+ +| ``INFO`` | 20 | ++--------------+---------------+ +| ``DEBUG`` | 10 | ++--------------+---------------+ +| ``NOTSET`` | 0 | ++--------------+---------------+ + + .. _handler: Handler Objects @@ -356,6 +386,8 @@ subclasses. However, the :meth:`__init__` method in subclasses needs to call severe than *lvl* will be ignored. When a handler is created, the level is set to :const:`NOTSET` (which causes all messages to be processed). + See :ref:`levels` for a list of levels. + .. versionchanged:: 3.2 The *lvl* parameter now accepts a string representation of the level such as 'INFO' as an alternative to the integer constants |