Skip to content

Fix debug logging interpolation#2849

Merged
gaborbernat merged 1 commit intopypa:mainfrom
tipabu:logging-interpolation
Feb 25, 2025
Merged

Fix debug logging interpolation#2849
gaborbernat merged 1 commit intopypa:mainfrom
tipabu:logging-interpolation

Conversation

@tipabu
Copy link
Copy Markdown
Contributor

@tipabu tipabu commented Feb 25, 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, remove the formatting placeholder from the message passed by concrete classes. msg then becomes unnecessary; pass it in as part of msg_args. The result is more like

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

Sorry; previously was #2848 but I accidentally closed it.

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

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, remove the formatting placeholder from the message passed by
concrete classes. msg then becomes unnecessary; pass it in as part
of msg_args. The result is more like

   wrote python info of /usr/bin/python3.12 at /home/...f265.json
   [DEBUG via_disk_folder:153]
@gaborbernat gaborbernat merged commit 7365ad2 into pypa:main Feb 25, 2025
40 checks passed
@tipabu tipabu deleted the logging-interpolation branch February 25, 2025 17:52
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