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

Log formatting of classes/types is broken #12323

Closed
thevintik opened this issue Sep 29, 2024 · 0 comments · Fixed by #12324
Closed

Log formatting of classes/types is broken #12323

thevintik opened this issue Sep 29, 2024 · 0 comments · Fixed by #12324
Labels

Comments

@thevintik
Copy link
Contributor

Describe the incorrect behavior you saw
Attempt to write type in log fails.

Describe how to cause this behavior
Emit log message that implies some type formatting.

>>> from twisted.logger import eventAsText
>>> eventAsText({"log_format": "{value}", "value": RuntimeError})
"- [-#-] Unable to format event {'log_format': '{value}', 'value': <class 'RuntimeError'>}: object.__format__() takes exactly one argument (0 given)"

Describe the correct behavior you'd like to see
Type is being formatted just like in format() call.

Additional context
The regression was introduced in Twisted 24.3.0 (#12040)
23.10.0 works fine:

>>> from twisted.logger import eventAsText
>>> eventAsText({"log_format": "{value}", "value": RuntimeError})
"- [-#-] <class 'RuntimeError'>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant