Skip to content

Commit 0653fba

Browse files
authored
bpo-30862: Updated Logger.setLevel documentation. (GH-2604)
1 parent b4baace commit 0653fba

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Doc/library/logging.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,14 @@ is the module's name in the Python package namespace.
9494
.. method:: Logger.setLevel(lvl)
9595

9696
Sets the threshold for this logger to *lvl*. Logging messages which are less
97-
severe than *lvl* will be ignored. When a logger is created, the level is set to
98-
:const:`NOTSET` (which causes all messages to be processed when the logger is
99-
the root logger, or delegation to the parent when the logger is a non-root
100-
logger). Note that the root logger is created with level :const:`WARNING`.
97+
severe than *lvl* will be ignored; logging messages which have severity *lvl*
98+
or higher will be emitted by whichever handler or handlers service this logger,
99+
unless a handler's level has been set to a higher severity level than *lvl*.
100+
101+
When a logger is created, the level is set to :const:`NOTSET` (which causes
102+
all messages to be processed when the logger is the root logger, or delegation
103+
to the parent when the logger is a non-root logger). Note that the root logger
104+
is created with level :const:`WARNING`.
101105

102106
The term 'delegation to the parent' means that if a logger has a level of
103107
NOTSET, its chain of ancestor loggers is traversed until either an ancestor with

0 commit comments

Comments
 (0)