Skip to content

Commit fa6cd7f

Browse files
[3.12] Docs: Fix Sphinx warnings in logging.rst (GH-108139) (#108174)
(cherry picked from commit c735e79) Co-authored-by: Adam Turner <[email protected]>
1 parent 97d67e9 commit fa6cd7f

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
@@ -439,7 +439,7 @@ Handler Objects
439439

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

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

1018-
In addition to the above, :class:`LoggerAdapter` supports the following
1019-
methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`,
1020-
:meth:`~Logger.warning`, :meth:`~Logger.error`, :meth:`~Logger.exception`,
1021-
:meth:`~Logger.critical`, :meth:`~Logger.log`, :meth:`~Logger.isEnabledFor`,
1022-
:meth:`~Logger.getEffectiveLevel`, :meth:`~Logger.setLevel` and
1023-
:meth:`~Logger.hasHandlers`. These methods have the same signatures as their
1024-
counterparts in :class:`Logger`, so you can use the two types of instances
1025-
interchangeably.
1018+
In addition to the above, :class:`LoggerAdapter` supports the following
1019+
methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`,
1020+
:meth:`~Logger.warning`, :meth:`~Logger.error`, :meth:`~Logger.exception`,
1021+
:meth:`~Logger.critical`, :meth:`~Logger.log`, :meth:`~Logger.isEnabledFor`,
1022+
:meth:`~Logger.getEffectiveLevel`, :meth:`~Logger.setLevel` and
1023+
:meth:`~Logger.hasHandlers`. These methods have the same signatures as their
1024+
counterparts in :class:`Logger`, so you can use the two types of instances
1025+
interchangeably.
10261026

1027-
.. versionchanged:: 3.2
1028-
The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`,
1029-
:meth:`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added
1030-
to :class:`LoggerAdapter`. These methods delegate to the underlying logger.
1027+
.. versionchanged:: 3.2
1028+
1029+
The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`,
1030+
:meth:`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added
1031+
to :class:`LoggerAdapter`. These methods delegate to the underlying logger.
1032+
1033+
.. versionchanged:: 3.6
10311034

1032-
.. versionchanged:: 3.6
1033-
Attribute :attr:`manager` and method :meth:`_log` were added, which
1034-
delegate to the underlying logger and allow adapters to be nested.
1035+
Attribute :attr:`!manager` and method :meth:`!_log` were added, which
1036+
delegate to the underlying logger and allow adapters to be nested.
10351037

10361038

10371039
Thread Safety
@@ -1415,8 +1417,8 @@ functions.
14151417
.. function:: setLoggerClass(klass)
14161418

14171419
Tells the logging system to use the class *klass* when instantiating a logger.
1418-
The class should define :meth:`__init__` such that only a name argument is
1419-
required, and the :meth:`__init__` should call :meth:`Logger.__init__`. This
1420+
The class should define :meth:`!__init__` such that only a name argument is
1421+
required, and the :meth:`!__init__` should call :meth:`!Logger.__init__`. This
14201422
function is typically called before any loggers are instantiated by applications
14211423
which need to use custom logger behavior. After this call, as at any other
14221424
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
@@ -98,7 +98,6 @@ Doc/library/inspect.rst
9898
Doc/library/locale.rst
9999
Doc/library/logging.config.rst
100100
Doc/library/logging.handlers.rst
101-
Doc/library/logging.rst
102101
Doc/library/lzma.rst
103102
Doc/library/mailbox.rst
104103
Doc/library/mmap.rst

0 commit comments

Comments
 (0)