Skip to content

Commit cdbff35

Browse files
authored
[doc] Update documentation on logging optimization. (GH-22075)
1 parent e55a0e9 commit cdbff35

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

Doc/howto/logging.rst

+16-14
Original file line numberDiff line numberDiff line change
@@ -1078,20 +1078,22 @@ need more precise control over what logging information is collected. Here's a
10781078
list of things you can do to avoid processing during logging which you don't
10791079
need:
10801080

1081-
+-----------------------------------------------+----------------------------------------+
1082-
| What you don't want to collect | How to avoid collecting it |
1083-
+===============================================+========================================+
1084-
| Information about where calls were made from. | Set ``logging._srcfile`` to ``None``. |
1085-
| | This avoids calling |
1086-
| | :func:`sys._getframe`, which may help |
1087-
| | to speed up your code in environments |
1088-
| | like PyPy (which can't speed up code |
1089-
| | that uses :func:`sys._getframe`). |
1090-
+-----------------------------------------------+----------------------------------------+
1091-
| Threading information. | Set ``logging.logThreads`` to ``0``. |
1092-
+-----------------------------------------------+----------------------------------------+
1093-
| Process information. | Set ``logging.logProcesses`` to ``0``. |
1094-
+-----------------------------------------------+----------------------------------------+
1081+
+-----------------------------------------------------+---------------------------------------------------+
1082+
| What you don't want to collect | How to avoid collecting it |
1083+
+=====================================================+===================================================+
1084+
| Information about where calls were made from. | Set ``logging._srcfile`` to ``None``. |
1085+
| | This avoids calling :func:`sys._getframe`, which |
1086+
| | may help to speed up your code in environments |
1087+
| | like PyPy (which can't speed up code that uses |
1088+
| | :func:`sys._getframe`). |
1089+
+-----------------------------------------------------+---------------------------------------------------+
1090+
| Threading information. | Set ``logging.logThreads`` to ``False``. |
1091+
+-----------------------------------------------------+---------------------------------------------------+
1092+
| Current process ID (:func:`os.getpid`) | Set ``logging.logProcesses`` to ``False``. |
1093+
+-----------------------------------------------------+---------------------------------------------------+
1094+
| Current process name when using ``multiprocessing`` | Set ``logging.logMultiprocessing`` to ``False``. |
1095+
| to manage multiple processes. | |
1096+
+-----------------------------------------------------+---------------------------------------------------+
10951097

10961098
Also note that the core logging module only includes the basic handlers. If
10971099
you don't import :mod:`logging.handlers` and :mod:`logging.config`, they won't

0 commit comments

Comments
 (0)