Skip to content

Fix debug logging interpolation#2848

Closed
tipabu wants to merge 0 commit intopypa:mainfrom
tipabu:logging-interpolation
Closed

Fix debug logging interpolation#2848
tipabu wants to merge 0 commit intopypa:mainfrom
tipabu:logging-interpolation

Conversation

@tipabu
Copy link
Copy Markdown
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
Copy Markdown
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