Skip to content

Commit 420db10

Browse files
[3.12] gh-101100: Fix Sphinx warnings in the Logging Cookbook (GH-108678) (#108680)
gh-101100: Fix Sphinx warnings in the Logging Cookbook (GH-108678) (cherry picked from commit c7cef54) Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
1 parent 2e60d58 commit 420db10

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

Doc/howto/logging-cookbook.rst

+11-4
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ printed on the console; on the server side, you should see something like:
761761
762762
Note that there are some security issues with pickle in some scenarios. If
763763
these affect you, you can use an alternative serialization scheme by overriding
764-
the :meth:`~handlers.SocketHandler.makePickle` method and implementing your
764+
the :meth:`~SocketHandler.makePickle` method and implementing your
765765
alternative there, as well as adapting the above script to use your alternative
766766
serialization.
767767

@@ -835,6 +835,8 @@ To test these files, do the following in a POSIX environment:
835835
You may need to tweak the configuration files in the unlikely event that the
836836
configured ports clash with something else in your test environment.
837837

838+
.. currentmodule:: logging
839+
838840
.. _context-info:
839841

840842
Adding contextual information to your logging output
@@ -1546,7 +1548,7 @@ Sometimes you want to let a log file grow to a certain size, then open a new
15461548
file and log to that. You may want to keep a certain number of these files, and
15471549
when that many files have been created, rotate the files so that the number of
15481550
files and the size of the files both remain bounded. For this usage pattern, the
1549-
logging package provides a :class:`~handlers.RotatingFileHandler`::
1551+
logging package provides a :class:`RotatingFileHandler`::
15501552

15511553
import glob
15521554
import logging
@@ -1594,6 +1596,8 @@ and each time it reaches the size limit it is renamed with the suffix
15941596
Obviously this example sets the log length much too small as an extreme
15951597
example. You would want to set *maxBytes* to an appropriate value.
15961598

1599+
.. currentmodule:: logging
1600+
15971601
.. _format-styles:
15981602

15991603
Use of alternative formatting styles
@@ -1840,6 +1844,7 @@ However, it should be borne in mind that each link in the chain adds run-time
18401844
overhead to all logging operations, and the technique should only be used when
18411845
the use of a :class:`Filter` does not provide the desired result.
18421846

1847+
.. currentmodule:: logging.handlers
18431848

18441849
.. _zeromq-handlers:
18451850

@@ -1917,6 +1922,8 @@ of queues, for example a ZeroMQ 'subscribe' socket. Here's an example::
19171922
:ref:`A more advanced logging tutorial <logging-advanced-tutorial>`
19181923

19191924

1925+
.. currentmodule:: logging
1926+
19201927
An example dictionary-based configuration
19211928
-----------------------------------------
19221929

@@ -3918,8 +3925,8 @@ that in other languages such as Java and C#, loggers are often static class
39183925
attributes. However, this pattern doesn't make sense in Python, where the
39193926
module (and not the class) is the unit of software decomposition.
39203927

3921-
Adding handlers other than :class:`NullHandler` to a logger in a library
3922-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3928+
Adding handlers other than :class:`~logging.NullHandler` to a logger in a library
3929+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39233930

39243931
Configuring logging by adding handlers, formatters and filters is the
39253932
responsibility of the application developer, not the library developer. If you

Doc/tools/.nitignore

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Doc/glossary.rst
2828
Doc/howto/descriptor.rst
2929
Doc/howto/enum.rst
3030
Doc/howto/isolating-extensions.rst
31-
Doc/howto/logging-cookbook.rst
3231
Doc/howto/logging.rst
3332
Doc/howto/urllib2.rst
3433
Doc/library/2to3.rst

0 commit comments

Comments
 (0)