Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logging geteffectivelevel does not document its return value #66626

Closed
bitdancer opened this issue Sep 18, 2014 · 5 comments
Closed

logging geteffectivelevel does not document its return value #66626

bitdancer opened this issue Sep 18, 2014 · 5 comments
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@bitdancer
Copy link
Member

BPO 22436
Nosy @vsajip, @bitdancer

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2014-09-18.17:03:18.166>
created_at = <Date 2014-09-18.14:26:28.164>
labels = ['type-bug', 'docs']
title = 'logging geteffectivelevel does not document its return value'
updated_at = <Date 2014-09-18.17:54:21.243>
user = 'https://github.com/bitdancer'

bugs.python.org fields:

activity = <Date 2014-09-18.17:54:21.243>
actor = 'r.david.murray'
assignee = 'docs@python'
closed = True
closed_date = <Date 2014-09-18.17:03:18.166>
closer = 'python-dev'
components = ['Documentation']
creation = <Date 2014-09-18.14:26:28.164>
creator = 'r.david.murray'
dependencies = []
files = []
hgrepos = []
issue_num = 22436
keywords = []
message_count = 5.0
messages = ['227047', '227052', '227054', '227056', '227057']
nosy_count = 4.0
nosy_names = ['vinay.sajip', 'r.david.murray', 'docs@python', 'python-dev']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue22436'
versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

@bitdancer
Copy link
Member Author

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.

@bitdancer bitdancer added docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error labels Sep 18, 2014
@vsajip
Copy link
Member

vsajip commented Sep 18, 2014

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.

@python-dev
Copy link
Mannequin

python-dev mannequin commented Sep 18, 2014

New changeset dd17c3eda73c by Vinay Sajip in branch '2.7':
Issue bpo-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 bpo-22436: Improved documentation for getEffectiveLevel() and getLevelName().
https://hg.python.org/cpython/rev/72a91df86b07

New changeset 49dfe2630ae3 by Vinay Sajip in branch 'default':
Closes bpo-22436: Merged documentation update from 3.4.
https://hg.python.org/cpython/rev/49dfe2630ae3

@python-dev python-dev mannequin closed this as completed Sep 18, 2014
@bitdancer
Copy link
Member Author

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.

@bitdancer
Copy link
Member Author

Woops, should have looked at the rest of my email. Yes, that change looks great.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants