Docs: Fix Sphinx warnings in logging.rst (GH-108139)

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
This commit is contained in:
Erlend E. Aasland 2023-08-20 13:19:07 +02:00 committed by GitHub
parent 4d4393139f
commit c735e79afb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 24 deletions

View file

@ -439,7 +439,7 @@ Handler Objects
Handlers have the following attributes and methods. Note that :class:`Handler` Handlers have the following attributes and methods. Note that :class:`Handler`
is never instantiated directly; this class acts as a base for more useful is never instantiated directly; this class acts as a base for more useful
subclasses. However, the :meth:`__init__` method in subclasses needs to call subclasses. However, the :meth:`!__init__` method in subclasses needs to call
:meth:`Handler.__init__`. :meth:`Handler.__init__`.
.. class:: Handler .. class:: Handler
@ -1029,19 +1029,23 @@ counterparts in :class:`Logger`, so you can use the two types of instances
interchangeably. interchangeably.
.. versionchanged:: 3.2 .. versionchanged:: 3.2
The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`, The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`,
:meth:`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added :meth:`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added
to :class:`LoggerAdapter`. These methods delegate to the underlying logger. to :class:`LoggerAdapter`. These methods delegate to the underlying logger.
.. versionchanged:: 3.6 .. versionchanged:: 3.6
Attribute :attr:`manager` and method :meth:`_log` were added, which
Attribute :attr:`!manager` and method :meth:`!_log` were added, which
delegate to the underlying logger and allow adapters to be nested. delegate to the underlying logger and allow adapters to be nested.
.. versionchanged:: 3.13 .. versionchanged:: 3.13
Remove the undocumented ``warn()`` method which was an alias to the
``warning()`` method. Remove the undocumented :meth:`!warn`` method which was an alias to the
:meth:`!warning` method.
.. versionchanged:: 3.13 .. versionchanged:: 3.13
The *merge_extra* argument was added. The *merge_extra* argument was added.
@ -1430,8 +1434,8 @@ functions.
.. function:: setLoggerClass(klass) .. function:: setLoggerClass(klass)
Tells the logging system to use the class *klass* when instantiating a logger. Tells the logging system to use the class *klass* when instantiating a logger.
The class should define :meth:`__init__` such that only a name argument is The class should define :meth:`!__init__` such that only a name argument is
required, and the :meth:`__init__` should call :meth:`Logger.__init__`. This required, and the :meth:`!__init__` should call :meth:`!Logger.__init__`. This
function is typically called before any loggers are instantiated by applications function is typically called before any loggers are instantiated by applications
which need to use custom logger behavior. After this call, as at any other which need to use custom logger behavior. After this call, as at any other
time, do not instantiate loggers directly using the subclass: continue to use time, do not instantiate loggers directly using the subclass: continue to use

View file

@ -92,7 +92,6 @@ Doc/library/inspect.rst
Doc/library/locale.rst Doc/library/locale.rst
Doc/library/logging.config.rst Doc/library/logging.config.rst
Doc/library/logging.handlers.rst Doc/library/logging.handlers.rst
Doc/library/logging.rst
Doc/library/lzma.rst Doc/library/lzma.rst
Doc/library/mailbox.rst Doc/library/mailbox.rst
Doc/library/mmap.rst Doc/library/mmap.rst