Skip to content

logging: add some undocumented but used features #271

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

Closed
wants to merge 1 commit into from

Conversation

tharvik
Copy link
Contributor

@tharvik tharvik commented Jun 6, 2016

See #247.

I still need a list of wanted attributes, but here goes the changes about the type of message.

@gvanrossum
Copy link
Member

Honestly, I think I'd rather fix the user's code than weaken the stubs in this case. The docs say nothing about the type (they just call it "message") but the intention is pretty clearly that it's a format string using % formatting characters. The actual % operation happens in LogRecord.getMessage(), and it does call str() on the msg argument if it's not a basestring (or always in Python 3) but I'm still hesitant to decide whether this is really meant to be a feature given the lack of documentation.

Let's hold off on this until we get more complaints.

@tharvik
Copy link
Contributor Author

tharvik commented Jun 6, 2016

The docs say nothing about the type (they just call it "message") but the intention is pretty clearly that it's a format string using % formatting characters.

In the debug definition, it is stated as "The msg is the message format string", so IMO, that's really a string and not any other object.

As we agree, I'm closing this PR.

@tharvik tharvik closed this Jun 6, 2016
@tharvik tharvik deleted the add_undocumented_logging branch August 8, 2016 06:47
hswong3i pushed a commit to alvistack/python-typeshed that referenced this pull request May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants