[Python-checkins] cpython (2.7): Issue #22436: Improved documentation for getEffectiveLevel() and getLevelName().
vinay.sajip
python-checkins at python.org
Thu Sep 18 19:02:59 CEST 2014
http://hg.python.org/cpython/rev/dd17c3eda73c
changeset: 92468:dd17c3eda73c
branch: 2.7
parent: 92465:2e3a81a0fa14
user: Vinay Sajip <vinay_sajip at yahoo.co.uk>
date: Thu Sep 18 17:46:58 2014 +0100
summary:
Issue #22436: Improved documentation for getEffectiveLevel() and getLevelName().
files:
Doc/library/logging.rst | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst
--- a/Doc/library/logging.rst
+++ b/Doc/library/logging.rst
@@ -130,7 +130,9 @@
Indicates the effective level for this logger. If a value other than
:const:`NOTSET` has been set using :meth:`setLevel`, it is returned. Otherwise,
the hierarchy is traversed towards the root until a value other than
- :const:`NOTSET` is found, and that value is returned.
+ :const:`NOTSET` is found, and that value is returned. The value returned is
+ an integer, typically one of :const:`logging.DEBUG`, :const:`logging.INFO`
+ etc.
.. method:: Logger.getChild(suffix)
@@ -898,6 +900,12 @@
of the defined levels is passed in, the corresponding string representation is
returned. Otherwise, the string "Level %s" % lvl is returned.
+ .. note:: Integer levels should be used when e.g. setting levels on instances
+ of :class:`Logger` and handlers. This function is used to convert between
+ an integer level and the level name displayed in the formatted log output
+ by means of the ``%(levelname)s`` format specifier (see
+ :ref:`logrecord-attributes`).
+
.. function:: makeLogRecord(attrdict)
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list