Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 753b664

Browse filesBrowse files
[3.12] gh-115811: Update documentation to add some Logger attributes. (GH-116109) (GH-116185)
(cherry picked from commit 3b6f4ca)
1 parent 2cf68db commit 753b664
Copy full SHA for 753b664

File tree

Expand file treeCollapse file tree

1 file changed

+36
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+36
-0
lines changed

‎Doc/library/logging.rst

Copy file name to clipboardExpand all lines: Doc/library/logging.rst
+36Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,27 @@ is the module's name in the Python package namespace.
7777

7878
.. class:: Logger
7979

80+
.. attribute:: Logger.name
81+
82+
This is the logger's name, and is the value that was passed to :func:`getLogger`
83+
to obtain the logger.
84+
85+
.. note:: This attribute should be treated as read-only.
86+
87+
.. attribute:: Logger.level
88+
89+
The threshold of this logger, as set by the :meth:`setLevel` method.
90+
91+
.. note:: Do not set this attribute directly - always use :meth:`setLevel`,
92+
which has checks for the level passed to it.
93+
94+
.. attribute:: Logger.parent
95+
96+
The parent logger of this logger. It may change based on later instantiation
97+
of loggers which are higher up in the namespace hierarchy.
98+
99+
.. note:: This value should be treated as read-only.
100+
80101
.. attribute:: Logger.propagate
81102

82103
If this attribute evaluates to true, events logged to this logger will be
@@ -108,6 +129,21 @@ is the module's name in the Python package namespace.
108129
scenario is to attach handlers only to the root logger, and to let
109130
propagation take care of the rest.
110131

132+
.. attribute:: Logger.handlers
133+
134+
The list of handlers directly attached to this logger instance.
135+
136+
.. note:: This attribute should be treated as read-only; it is normally changed via
137+
the :meth:`addHandler` and :meth:`removeHandler` methods, which use locks to ensure
138+
thread-safe operation.
139+
140+
.. attribute:: Logger.disabled
141+
142+
This attribute disables handling of any events. It is set to ``False`` in the
143+
initializer, and only changed by logging configuration code.
144+
145+
.. note:: This attribute should be treated as read-only.
146+
111147
.. method:: Logger.setLevel(level)
112148

113149
Sets the threshold for this logger to *level*. Logging messages which are less

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.