summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorandrei kulakov <andrei.avk@gmail.com>2021-06-03 08:12:59 (GMT)
committerGitHub <noreply@github.com>2021-06-03 08:12:59 (GMT)
commit8b93f0e696d3fc60fd311c13d5238da73a35e3b3 (patch)
tree0d1b5fd01fe4c7ab9ee1c38b801274a085bd7c4a /Doc
parent4846ea95d1a121df5e8081e2a290f63d1419cad8 (diff)
downloadcpython-8b93f0e696d3fc60fd311c13d5238da73a35e3b3.zip
cpython-8b93f0e696d3fc60fd311c13d5238da73a35e3b3.tar.gz
cpython-8b93f0e696d3fc60fd311c13d5238da73a35e3b3.tar.bz2
bpo-43858: Add logging.getLevelNamesMapping() (GH-26459)
Added a function that returns a copy of a dict of logging levels.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/logging.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst
index 70a703d..313cff4 100644
--- a/Doc/library/logging.rst
+++ b/Doc/library/logging.rst
@@ -1111,6 +1111,14 @@ functions.
.. note:: If you are thinking of defining your own levels, please see the
section on :ref:`custom-levels`.
+.. function:: getLevelNamesMapping()
+
+ Returns a mapping from level names to their corresponding logging levels. For example, the
+ string "CRITICAL" maps to :const:`CRITICAL`. The returned mapping is copied from an internal
+ mapping on each call to this function.
+
+ .. versionadded:: 3.11
+
.. function:: getLevelName(level)
Returns the textual or numeric representation of logging level *level*.