Skip to content

[3.7] bpo-38235: Correct some arguments names in logging documentation (GH-16571) #16577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions Doc/library/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`.


Expand Down Expand Up @@ -258,9 +258,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`.


Expand Down Expand Up @@ -315,7 +315,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.
Expand Down Expand Up @@ -1041,12 +1041,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
Expand All @@ -1056,16 +1056,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
Expand All @@ -1075,15 +1075,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
Expand Down