-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
LoggerAdapter and %(funcName)s prints the wrong function name #115233
Comments
bisected to 5ca6d74 he changed currentframe function Thanks, @Eclips4 for help |
Thanks all for the discussion. Issue aside, I think it would be really helpful to have some comments for 5ca6d74#diff-1bf0ad6d121df3948853dafdd8e5406709fe0c3911b30e3cf2def41717455c98L162 as |
|
Also add more tests for LoggerAdapter. Also support stacklevel in LoggerAdapter._log().
Also add more tests for LoggerAdapter. Also support stacklevel in LoggerAdapter._log().
…nGH-115325) Also add more tests for LoggerAdapter. Also support stacklevel in LoggerAdapter._log(). (cherry picked from commit 9182201) Co-authored-by: Serhiy Storchaka <[email protected]>
…nGH-115325) (pythonGH-115355) Also add more tests for LoggerAdapter. (cherry picked from commit 225856e) Co-authored-by: Serhiy Storchaka <[email protected]> Also support stacklevel in LoggerAdapter._log(). (cherry picked from commit 9182201)
…H-115355) (GH-115357) Also add more tests for LoggerAdapter. Also support stacklevel in LoggerAdapter._log(). (cherry picked from commit 225856e) (cherry picked from commit 9182201) Co-authored-by: Serhiy Storchaka <[email protected]>
Bug report
Bug description:
Using the StyleAdapter from the Cookbook https://docs.python.org/3/howto/logging-cookbook.html
With the %(funcName)s formatter
Yields the wrong funcName in 3.11 and later.
No matter where you use the StyleAdapter logger, it always prints "log"
CPython versions tested on:
3.10, 3.12
Operating systems tested on:
Windows
Linked PRs
The text was updated successfully, but these errors were encountered: