From 3142c667b50254daaa28f22c79bdda177136bd03 Mon Sep 17 00:00:00 2001 From: Ashley Whetter Date: Fri, 4 Oct 2019 00:55:14 -0700 Subject: [PATCH] bpo-38235: Correct some arguments names in logging documentation (GH-16571) --- Doc/library/logging.rst | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index dec27bff56..3ed24605db 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -124,11 +124,11 @@ is the module's name in the Python package namespace. :meth:`isEnabledFor` will return/expect to be passed integers. - .. method:: Logger.isEnabledFor(lvl) + .. method:: Logger.isEnabledFor(level) - Indicates if a message of severity *lvl* would be processed by this logger. + Indicates if a message of severity *level* would be processed by this logger. This method checks first the module-level level set by - ``logging.disable(lvl)`` and then the logger's effective level as determined + ``logging.disable(level)`` and then the logger's effective level as determined by :meth:`getEffectiveLevel`. @@ -269,9 +269,9 @@ is the module's name in the Python package namespace. interpreted as for :meth:`debug`. - .. method:: Logger.log(lvl, msg, *args, **kwargs) + .. method:: Logger.log(level, msg, *args, **kwargs) - Logs a message with integer level *lvl* on this logger. The other arguments are + Logs a message with integer level *level* on this logger. The other arguments are interpreted as for :meth:`debug`. @@ -333,7 +333,7 @@ is the module's name in the Python package namespace. Logger-level filtering is applied using :meth:`~Logger.filter`. - .. method:: Logger.makeRecord(name, lvl, fn, lno, msg, args, exc_info, func=None, extra=None, sinfo=None) + .. method:: Logger.makeRecord(name, level, fn, lno, msg, args, exc_info, func=None, extra=None, sinfo=None) This is a factory method which can be overridden in subclasses to create specialized :class:`LogRecord` instances. @@ -1066,12 +1066,12 @@ functions. handlers being added multiple times to the root logger, which can in turn lead to multiple messages for the same event. -.. function:: disable(lvl=CRITICAL) +.. function:: disable(level=CRITICAL) - Provides an overriding level *lvl* for all loggers which takes precedence over + Provides an overriding level *level* for all loggers which takes precedence over the logger's own level. When the need arises to temporarily throttle logging output down across the whole application, this function can be useful. Its - effect is to disable all logging calls of severity *lvl* and below, so that + effect is to disable all logging calls of severity *level* and below, so that if you call it with a value of INFO, then all INFO and DEBUG events would be discarded, whereas those of severity WARNING and above would be processed according to the logger's effective level. If @@ -1081,16 +1081,16 @@ functions. Note that if you have defined any custom logging level higher than ``CRITICAL`` (this is not recommended), you won't be able to rely on the - default value for the *lvl* parameter, but will have to explicitly supply a + default value for the *level* parameter, but will have to explicitly supply a suitable value. .. versionchanged:: 3.7 - The *lvl* parameter was defaulted to level ``CRITICAL``. See Issue + The *level* parameter was defaulted to level ``CRITICAL``. See Issue #28524 for more information about this change. -.. function:: addLevelName(lvl, levelName) +.. function:: addLevelName(level, levelName) - Associates level *lvl* with text *levelName* in an internal dictionary, which is + Associates level *level* with text *levelName* in an internal dictionary, which is used to map numeric levels to a textual representation, for example when a :class:`Formatter` formats a message. This function can also be used to define your own levels. The only constraints are that all levels used must be @@ -1100,15 +1100,15 @@ functions. .. note:: If you are thinking of defining your own levels, please see the section on :ref:`custom-levels`. -.. function:: getLevelName(lvl) +.. function:: getLevelName(level) - Returns the textual representation of logging level *lvl*. If the level is one + Returns the textual representation of logging level *level*. If the level is one of the predefined levels :const:`CRITICAL`, :const:`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the corresponding string. If you have associated levels with names using :func:`addLevelName` then the name you - have associated with *lvl* is returned. If a numeric value corresponding to one + have associated with *level* is returned. If a numeric value corresponding to one of the defined levels is passed in, the corresponding string representation is - returned. Otherwise, the string 'Level %s' % lvl is returned. + returned. Otherwise, the string 'Level %s' % level is returned. .. note:: Levels are internally integers (as they need to be compared in the logging logic). This function is used to convert between an integer level -- 2.40.0