Skip to content

Commit e5e87f2

Browse files
[3.11] Docs: Fix Sphinx warnings in logging.rst (GH-108139) (#108175)
(cherry picked from commit c735e79) Co-authored-by: Adam Turner <[email protected]>
1 parent 797e3c9 commit e5e87f2

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

Doc/library/logging.rst

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ Handler Objects
427427

428428
Handlers have the following attributes and methods. Note that :class:`Handler`
429429
is never instantiated directly; this class acts as a base for more useful
430-
subclasses. However, the :meth:`__init__` method in subclasses needs to call
430+
subclasses. However, the :meth:`!__init__` method in subclasses needs to call
431431
:meth:`Handler.__init__`.
432432

433433
.. class:: Handler
@@ -994,23 +994,25 @@ information into logging calls. For a usage example, see the section on
994994
'extra'. The return value is a (*msg*, *kwargs*) tuple which has the
995995
(possibly modified) versions of the arguments passed in.
996996

997-
In addition to the above, :class:`LoggerAdapter` supports the following
998-
methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`,
999-
:meth:`~Logger.warning`, :meth:`~Logger.error`, :meth:`~Logger.exception`,
1000-
:meth:`~Logger.critical`, :meth:`~Logger.log`, :meth:`~Logger.isEnabledFor`,
1001-
:meth:`~Logger.getEffectiveLevel`, :meth:`~Logger.setLevel` and
1002-
:meth:`~Logger.hasHandlers`. These methods have the same signatures as their
1003-
counterparts in :class:`Logger`, so you can use the two types of instances
1004-
interchangeably.
997+
In addition to the above, :class:`LoggerAdapter` supports the following
998+
methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`,
999+
:meth:`~Logger.warning`, :meth:`~Logger.error`, :meth:`~Logger.exception`,
1000+
:meth:`~Logger.critical`, :meth:`~Logger.log`, :meth:`~Logger.isEnabledFor`,
1001+
:meth:`~Logger.getEffectiveLevel`, :meth:`~Logger.setLevel` and
1002+
:meth:`~Logger.hasHandlers`. These methods have the same signatures as their
1003+
counterparts in :class:`Logger`, so you can use the two types of instances
1004+
interchangeably.
10051005

1006-
.. versionchanged:: 3.2
1007-
The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`,
1008-
:meth:`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added
1009-
to :class:`LoggerAdapter`. These methods delegate to the underlying logger.
1006+
.. versionchanged:: 3.2
1007+
1008+
The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`,
1009+
:meth:`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added
1010+
to :class:`LoggerAdapter`. These methods delegate to the underlying logger.
1011+
1012+
.. versionchanged:: 3.6
10101013

1011-
.. versionchanged:: 3.6
1012-
Attribute :attr:`manager` and method :meth:`_log` were added, which
1013-
delegate to the underlying logger and allow adapters to be nested.
1014+
Attribute :attr:`!manager` and method :meth:`!_log` were added, which
1015+
delegate to the underlying logger and allow adapters to be nested.
10141016

10151017

10161018
Thread Safety
@@ -1381,8 +1383,8 @@ functions.
13811383
.. function:: setLoggerClass(klass)
13821384

13831385
Tells the logging system to use the class *klass* when instantiating a logger.
1384-
The class should define :meth:`__init__` such that only a name argument is
1385-
required, and the :meth:`__init__` should call :meth:`Logger.__init__`. This
1386+
The class should define :meth:`!__init__` such that only a name argument is
1387+
required, and the :meth:`!__init__` should call :meth:`!Logger.__init__`. This
13861388
function is typically called before any loggers are instantiated by applications
13871389
which need to use custom logger behavior. After this call, as at any other
13881390
time, do not instantiate loggers directly using the subclass: continue to use

Doc/tools/.nitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ Doc/library/inspect.rst
9292
Doc/library/locale.rst
9393
Doc/library/logging.config.rst
9494
Doc/library/logging.handlers.rst
95-
Doc/library/logging.rst
9695
Doc/library/lzma.rst
9796
Doc/library/mailbox.rst
9897
Doc/library/mmap.rst

0 commit comments

Comments
 (0)