]> granicus.if.org Git - python/commitdiff
Issue #22436: Improved documentation for getEffectiveLevel() and getLevelName().
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Thu, 18 Sep 2014 16:46:58 +0000 (17:46 +0100)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Thu, 18 Sep 2014 16:46:58 +0000 (17:46 +0100)
Doc/library/logging.rst

index 0c50b2f8e96b0cfba301152ab07bc8189cf07aed..839bdc75797625871530aa9d56a9f7491f2f1c1c 100644 (file)
@@ -130,7 +130,9 @@ is the module's name in the Python package namespace.
    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 @@ functions.
    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)