[Python-checkins] cpython (merge 3.3 -> default): Closes #19902: Merged update from 3.3.

vinay.sajip python-checkins at python.org
Thu Dec 19 12:51:37 CET 2013


http://hg.python.org/cpython/rev/45bd58a15bb9
changeset:   88054:45bd58a15bb9
parent:      88051:6f41495e9336
parent:      88053:e812094d42f9
user:        Vinay Sajip <vinay_sajip at yahoo.co.uk>
date:        Thu Dec 19 11:51:19 2013 +0000
summary:
  Closes #19902: Merged update from 3.3.

files:
  Doc/library/logging.rst |  32 +++++++++++++++++++++++++++++
  1 files changed, 32 insertions(+), 0 deletions(-)


diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst
--- a/Doc/library/logging.rst
+++ b/Doc/library/logging.rst
@@ -113,6 +113,8 @@
    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 @@
    .. 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 @@
    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

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list