Skip to content

Commit 4f82a53

Browse files
miss-islingtonAWhetter
authored andcommitted
bpo-38235: Correct some arguments names in logging documentation (GH-16571) (GH-16577)
(cherry picked from commit 3142c66) Co-authored-by: Ashley Whetter <AWhetter@users.noreply.github.com>
1 parent 4de3fbe commit 4f82a53

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

Doc/library/logging.rst

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ is the module's name in the Python package namespace.
124124
:meth:`isEnabledFor` will return/expect to be passed integers.
125125

126126

127-
.. method:: Logger.isEnabledFor(lvl)
127+
.. method:: Logger.isEnabledFor(level)
128128

129-
Indicates if a message of severity *lvl* would be processed by this logger.
129+
Indicates if a message of severity *level* would be processed by this logger.
130130
This method checks first the module-level level set by
131-
``logging.disable(lvl)`` and then the logger's effective level as determined
131+
``logging.disable(level)`` and then the logger's effective level as determined
132132
by :meth:`getEffectiveLevel`.
133133

134134

@@ -258,9 +258,9 @@ is the module's name in the Python package namespace.
258258
interpreted as for :meth:`debug`.
259259

260260

261-
.. method:: Logger.log(lvl, msg, *args, **kwargs)
261+
.. method:: Logger.log(level, msg, *args, **kwargs)
262262

263-
Logs a message with integer level *lvl* on this logger. The other arguments are
263+
Logs a message with integer level *level* on this logger. The other arguments are
264264
interpreted as for :meth:`debug`.
265265

266266

@@ -315,7 +315,7 @@ is the module's name in the Python package namespace.
315315
Logger-level filtering is applied using :meth:`~Logger.filter`.
316316

317317

318-
.. method:: Logger.makeRecord(name, lvl, fn, lno, msg, args, exc_info, func=None, extra=None, sinfo=None)
318+
.. method:: Logger.makeRecord(name, level, fn, lno, msg, args, exc_info, func=None, extra=None, sinfo=None)
319319

320320
This is a factory method which can be overridden in subclasses to create
321321
specialized :class:`LogRecord` instances.
@@ -1041,12 +1041,12 @@ functions.
10411041
handlers being added multiple times to the root logger, which can in turn
10421042
lead to multiple messages for the same event.
10431043

1044-
.. function:: disable(lvl=CRITICAL)
1044+
.. function:: disable(level=CRITICAL)
10451045

1046-
Provides an overriding level *lvl* for all loggers which takes precedence over
1046+
Provides an overriding level *level* for all loggers which takes precedence over
10471047
the logger's own level. When the need arises to temporarily throttle logging
10481048
output down across the whole application, this function can be useful. Its
1049-
effect is to disable all logging calls of severity *lvl* and below, so that
1049+
effect is to disable all logging calls of severity *level* and below, so that
10501050
if you call it with a value of INFO, then all INFO and DEBUG events would be
10511051
discarded, whereas those of severity WARNING and above would be processed
10521052
according to the logger's effective level. If
@@ -1056,16 +1056,16 @@ functions.
10561056

10571057
Note that if you have defined any custom logging level higher than
10581058
``CRITICAL`` (this is not recommended), you won't be able to rely on the
1059-
default value for the *lvl* parameter, but will have to explicitly supply a
1059+
default value for the *level* parameter, but will have to explicitly supply a
10601060
suitable value.
10611061

10621062
.. versionchanged:: 3.7
1063-
The *lvl* parameter was defaulted to level ``CRITICAL``. See Issue
1063+
The *level* parameter was defaulted to level ``CRITICAL``. See Issue
10641064
#28524 for more information about this change.
10651065

1066-
.. function:: addLevelName(lvl, levelName)
1066+
.. function:: addLevelName(level, levelName)
10671067

1068-
Associates level *lvl* with text *levelName* in an internal dictionary, which is
1068+
Associates level *level* with text *levelName* in an internal dictionary, which is
10691069
used to map numeric levels to a textual representation, for example when a
10701070
:class:`Formatter` formats a message. This function can also be used to define
10711071
your own levels. The only constraints are that all levels used must be
@@ -1075,15 +1075,15 @@ functions.
10751075
.. note:: If you are thinking of defining your own levels, please see the
10761076
section on :ref:`custom-levels`.
10771077

1078-
.. function:: getLevelName(lvl)
1078+
.. function:: getLevelName(level)
10791079

1080-
Returns the textual representation of logging level *lvl*. If the level is one
1080+
Returns the textual representation of logging level *level*. If the level is one
10811081
of the predefined levels :const:`CRITICAL`, :const:`ERROR`, :const:`WARNING`,
10821082
:const:`INFO` or :const:`DEBUG` then you get the corresponding string. If you
10831083
have associated levels with names using :func:`addLevelName` then the name you
1084-
have associated with *lvl* is returned. If a numeric value corresponding to one
1084+
have associated with *level* is returned. If a numeric value corresponding to one
10851085
of the defined levels is passed in, the corresponding string representation is
1086-
returned. Otherwise, the string 'Level %s' % lvl is returned.
1086+
returned. Otherwise, the string 'Level %s' % level is returned.
10871087

10881088
.. note:: Levels are internally integers (as they need to be compared in the
10891089
logging logic). This function is used to convert between an integer level

0 commit comments

Comments
 (0)