mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
bpo-30862: Updated Logger.setLevel documentation. (GH-2604)
This commit is contained in:
parent
b4baacee1a
commit
0653fba51c
1 changed files with 8 additions and 4 deletions
|
@ -94,10 +94,14 @@ is the module's name in the Python package namespace.
|
||||||
.. method:: Logger.setLevel(lvl)
|
.. method:: Logger.setLevel(lvl)
|
||||||
|
|
||||||
Sets the threshold for this logger to *lvl*. Logging messages which are less
|
Sets the threshold for this logger to *lvl*. Logging messages which are less
|
||||||
severe than *lvl* will be ignored. When a logger is created, the level is set to
|
severe than *lvl* will be ignored; logging messages which have severity *lvl*
|
||||||
:const:`NOTSET` (which causes all messages to be processed when the logger is
|
or higher will be emitted by whichever handler or handlers service this logger,
|
||||||
the root logger, or delegation to the parent when the logger is a non-root
|
unless a handler's level has been set to a higher severity level than *lvl*.
|
||||||
logger). Note that the root logger is created with level :const:`WARNING`.
|
|
||||||
|
When a logger is created, the level is set to :const:`NOTSET` (which causes
|
||||||
|
all messages to be processed when the logger is the root logger, or delegation
|
||||||
|
to the parent when the logger is a non-root logger). Note that the root logger
|
||||||
|
is created with level :const:`WARNING`.
|
||||||
|
|
||||||
The term 'delegation to the parent' means that if a logger has a level of
|
The term 'delegation to the parent' means that if a logger has a level of
|
||||||
NOTSET, its chain of ancestor loggers is traversed until either an ancestor with
|
NOTSET, its chain of ancestor loggers is traversed until either an ancestor with
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue