This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: logging geteffectivelevel does not document its return value
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, python-dev, r.david.murray, vinay.sajip
Priority: normal Keywords:

Created on 2014-09-18 14:26 by r.david.murray, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (5)
msg227047 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-09-18 14:26
https://docs.python.org/3/library/logging.html#logging.Logger.getEffectiveLevel

This says the logging level is returned, but it doesn't mention that what is returned is an integer, nor does it link to whatever method is needed to convert the integer return value into the symbolic name that the user has been using elsewhere in interacting with logging.  Indeed, the section that shows the mapping between names and numbers implies that the user of the library never needs to worry about the numbers unless they are creating a new level, but if they want to use getEffectiveLevel, this is not true.
msg227052 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2014-09-18 16:36
Users generally use integer values when specifying logging levels, unless they are e.g. using the configuration machinery, when they will specify strings (just because the configuration is in text files).

I will update the documentation to try to make things clearer.
msg227054 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-09-18 17:03
New changeset dd17c3eda73c by Vinay Sajip in branch '2.7':
Issue #22436: Improved documentation for getEffectiveLevel() and getLevelName().
https://hg.python.org/cpython/rev/dd17c3eda73c

New changeset 72a91df86b07 by Vinay Sajip in branch '3.4':
Issue #22436: Improved documentation for getEffectiveLevel() and getLevelName().
https://hg.python.org/cpython/rev/72a91df86b07

New changeset 49dfe2630ae3 by Vinay Sajip in branch 'default':
Closes #22436: Merged documentation update from 3.4.
https://hg.python.org/cpython/rev/49dfe2630ae3
msg227056 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-09-18 17:53
Ah, yes, I was just being dense, because the context I was in was exactly that context: configuration via strings.  Probably no change is required, but if can think of way of making it obvious to someone thinking crooked like I was that would be great.
msg227057 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-09-18 17:54
Woops, should have looked at the rest of my email.  Yes, that change looks great.
History
Date User Action Args
2022-04-11 14:58:08adminsetgithub: 66626
2014-09-18 17:54:21r.david.murraysetmessages: + msg227057
2014-09-18 17:53:15r.david.murraysetmessages: + msg227056
2014-09-18 17:03:18python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg227054

resolution: fixed
stage: resolved
2014-09-18 16:36:06vinay.sajipsetmessages: + msg227052
2014-09-18 14:26:28r.david.murraycreate