diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2017-07-06 16:51:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-06 16:51:28 (GMT) |
commit | 0653fba51c03d20fa4381ba0836acd17fd05b04b (patch) | |
tree | 157bf1ed9fb6ab7f08bc2347152df19b440a882b /Doc/library/logging.rst | |
parent | b4baacee1adc06edbe30ac7574d17a8cd168e2e0 (diff) | |
download | cpython-0653fba51c03d20fa4381ba0836acd17fd05b04b.zip cpython-0653fba51c03d20fa4381ba0836acd17fd05b04b.tar.gz cpython-0653fba51c03d20fa4381ba0836acd17fd05b04b.tar.bz2 |
bpo-30862: Updated Logger.setLevel documentation. (GH-2604)
Diffstat (limited to 'Doc/library/logging.rst')
-rw-r--r-- | Doc/library/logging.rst | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index 1b27241..d2c6c90 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -94,10 +94,14 @@ is the module's name in the Python package namespace. .. method:: Logger.setLevel(lvl) 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 - :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`. + severe than *lvl* will be ignored; logging messages which have severity *lvl* + or higher will be emitted by whichever handler or handlers service this logger, + unless a handler's level has been set to a higher severity level than *lvl*. + + 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 NOTSET, its chain of ancestor loggers is traversed until either an ancestor with |