Message204451
In http://bugs.python.org/issue14864, this line was added to the logging.disable docstring:
To undo the effect of a call to logging.disable(lvl), call logging.disable(logging.NOTSET).
To prevent misunderstanding, I propose that this line be changed to:
Calling logging.disable(logging.NOTSET) will undo all previous calls to logging.disable(lvl).
While the original change was an improvement, it's misleading. "undoing the effect of a call" reads as "undoing the effect of the last call", which implies a stack -- think of text editor "undo" functionality. In other words, the current documentation implies behavior like a context manager:
>>> import logging
# start with all logging enabled
>>> logging.disable(logging.CRITICAL)
# all logging disabled
>>> logging.disable(logging.WARNING)
# only CRITICAL enabled
>>> logging.disable(logging.NOTSET)
# undo; all logging disabled
>>> logging.disable(logging.NOTSET)
# undo; all logging enabled
Since logging.disable is idempotent, we're not undoing *a call*, we're undoing *all calls*. |
|
Date |
User |
Action |
Args |
2013-11-26 05:14:20 | simonmweber | set | recipients:
+ simonmweber, georg.brandl, ezio.melotti, eric.araujo, docs@python |
2013-11-26 05:14:20 | simonmweber | set | messageid: <1385442860.38.0.88263802784.issue19789@psf.upfronthosting.co.za> |
2013-11-26 05:14:20 | simonmweber | link | issue19789 messages |
2013-11-26 05:14:19 | simonmweber | create | |
|