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

Fix debug logging interpolation #2848

Closed
wants to merge 0 commits into from
Closed

Conversation

tipabu
Copy link
Contributor

@tipabu tipabu commented Feb 24, 2025

Previously, message and args would each get interpolated separately, with a result like

wrote python info of %s at (PosixPath('/usr/bin/python3.12'), PosixPath('/home/...f265.json')) [DEBUG via_disk_folder:153]

Now, interpolate the message (which has its own formatting placeholder) first, then the args; the result is more like

wrote python info of /usr/bin/python3.12 at /home/...f265.json [DEBUG via_disk_folder:153]

Thanks for contributing, make sure you address all the checklists (for details on how see development documentation)

  • ran the linter to address style issues (tox -e fix)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix
  • added news fragment in docs/changelog folder
  • updated/extended the documentation

@tipabu tipabu force-pushed the logging-interpolation branch from d757d00 to 7a8024e Compare February 24, 2025 23:26
Copy link
Contributor

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use logging formatting and not f-string formatting.

@gaborbernat gaborbernat marked this pull request as draft February 25, 2025 01:47
@tipabu tipabu closed this Feb 25, 2025
@tipabu tipabu force-pushed the logging-interpolation branch from 7a8024e to eaef9bb Compare February 25, 2025 02:14
@tipabu tipabu mentioned this pull request Feb 25, 2025
5 tasks
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