8000 Docs: Fix Sphinx warnings in logging.rst (GH-108139) · python/cpython@c735e79 · GitHub
[go: up one dir, main page]

Skip to content

Commit c735e79

Browse files
Docs: Fix Sphinx warnings in logging.rst (GH-108139)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
1 parent 4d43931 commit c735e79

File tree

2 files changed

+27
-24
lines changed

2 files changed

+27
-24
lines changed

Doc/library/logging.rst

Lines changed: 27 additions & 23 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
@@ -1019,30 +1019,34 @@ information into logging calls. For a usage example, see the section on
10191019
'extra'. The return value is a (*msg*, *kwargs*) tuple which has the
10201020
(possibly modified) versions of the arguments passed in.
10211021

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

1031-
.. versionchanged:: 3.2
1032-
The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`,
1033-
:meth:`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added
1034-
to :class:`LoggerAdapter`. These methods delegate to the underlying logger.
1031+
.. versionchanged:: 3.2
1032+
1033+
The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`,
1034+
:meth:`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added
1035+
to :class:`LoggerAdapter`. These methods delegate to the underlying logger.
1036+
1037+
.. versionchanged:: 3.6
10351038

1036-
.. versionchanged:: 3.6
1037-
Attribute :attr:`manager` and method :meth:`_log` were added, which
1038-
delegate to the underlying logger and allow adapters to be nested.
1039+
Attribute :attr:`!manager` and method :meth:`!_log` were added, which
1040+
delegate to the underlying logger and allow adapters to be nested.
10391041

1040-
.. versionchanged:: 3.13
1041-
Remove the undocumented ``warn()`` method which was an alias to the
1042-
``warning()`` method.
1042+
.. versionchanged:: 3.13
1043+
1044+
Remove the undocumented :meth:`!warn`` method which was an alias to the
1045+
:meth:`!warning` method.
1046+
1047+
.. versionchanged:: 3.13
10431048

1044-
.. versionchanged:: 3.13
1045-
The *merge_extra* argument was added.
1049+
The *merge_extra* argument was added.
10461050

10471051

10481052
Thread Safety
@@ -1430,8 +1434,8 @@ functions.
14301434
.. function:: setLoggerClass(klass)
14311435

14321436
Tells the logging system to use the class *klass* when instantiating a logger.
1433-
The class should define :meth:`__init__` such that only a name argument is
1434-
required, and the :meth:`__init__` should call :meth:`Logger.__init__`. This
1437+
The class should define :meth:`!__init__` such that only a name argument is
1438+
required, and the :meth:`!__init__` should call :meth:`!Logger.__init__`. This
14351439
function is typically called before any loggers are instantiated by applications
14361440
which need to use custom logger behavior. After this call, as at any other
14371441
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)
0