-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
logging module LogRecord can accept non-str msg but it's not documented #102873
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
Labels
docs
Documentation in the Doc dir
Comments
cc @AlexWaygood |
@vsajip (as a logging expert) |
AlexWaygood
added a commit
that referenced
this issue
Mar 24, 2023
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Mar 24, 2023
… parameter (pythonGH-102875) (cherry picked from commit f2e5a6e) Co-authored-by: Amin Alaee <mohammadamin.alaee@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Mar 24, 2023
… parameter (pythonGH-102875) (cherry picked from commit f2e5a6e) Co-authored-by: Amin Alaee <mohammadamin.alaee@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
miss-islington
added a commit
that referenced
this issue
Mar 24, 2023
miss-islington
added a commit
that referenced
this issue
Mar 24, 2023
Thanks @aminalaee! |
Fidget-Spinner
pushed a commit
to Fidget-Spinner/cpython
that referenced
this issue
Mar 27, 2023
… parameter (python#102875) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
warsaw
pushed a commit
to warsaw/cpython
that referenced
this issue
Apr 11, 2023
… parameter (python#102875) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Documentation
In the documentation of the logging
LogRecord
it's mentioned that it accepts msg as str argument:https://docs.python.org/3/library/logging.html#logging.LogRecord
But just below that it explains that in
getMessage
:So non-str messages are allowed, and also in LogRecord attributes it's mentioned that non-str messages work and are accepted:
https://docs.python.org/3/library/logging.html#logrecord-attributes
Initially started the discussion in python/typeshed#9914
Linked PRs
msg
parameter (GH-102875) #103003msg
parameter (GH-102875) #103004The text was updated successfully, but these errors were encountered: