8000 [3.12] Docs: Fix Sphinx warnings in logging.rst (GH-108139) by erlend-aasland · Pull Request #108174 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.12] Docs: Fix Sphinx warnings in logging.rst (GH-108139) #108174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions Doc/library/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ Handler Objects

Handlers have the following attributes and methods. Note that :class:`Handler`
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__`.

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

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

.. versionchanged:: 3.2
The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`,
:meth:`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added
to :class:`LoggerAdapter`. These methods delegate to the underlying logger.
.. versionchanged:: 3.2

The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`,
:meth:`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added
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
delegate to the underlying logger and allow adapters to be nested.
Attribute :attr:`!manager` and method :meth:`!_log` were added, which
delegate to the underlying logger and allow adapters to be nested.


Thread Safety
Expand Down Expand Up @@ -1415,8 +1417,8 @@ functions.
.. function:: setLoggerClass(klass)

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
required, and the :meth:`__init__` should call :meth:`Logger.__init__`. This
The class should define :meth:`!__init__` such that only a name argument is
required, and the :meth:`!__init__` should call :meth:`!Logger.__init__`. This
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
time, do not instantiate loggers directly using the subclass: continue to use
Expand Down
1 change: 0 additions & 1 deletion Doc/tools/.nitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ Doc/library/inspect.rst
Doc/library/locale.rst
Doc/library/logging.config.rst
Doc/library/logging.handlers.rst
Doc/library/logging.rst
Doc/library/lzma.rst
Doc/library/mailbox.rst
Doc/library/mmap.rst
Expand Down
0