Skip to content

Fix up use of %-style log formatting #2838

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

Closed
2 tasks
alexwlchan opened this issue May 12, 2017 · 2 comments
Closed
2 tasks

Fix up use of %-style log formatting #2838

alexwlchan opened this issue May 12, 2017 · 2 comments
Labels
Improvement Minor improvement to code
Milestone

Comments

@alexwlchan
Copy link
Contributor

There are a bunch of logging calls that look like this:

log.info("Lock (%s): Releasing" % self.name)

Better practice is to pass the substitutions as extra arguments to the log function:

log.info("Lock (%s): Releasing", self.name)

so the string substitution is only performed if the message is actually logged.

I'll tackle this after I've finished the PEP 257 cleanup (#1474). Two parts:

  • Fix any outstanding logs
  • Enable linting to prevent it creeping back in later
@agjohnson
Copy link
Contributor

Another great place to clean up some cruft. We currently have no standard for logging, so our log messages are all over the place. Perhaps that is cleanup for another day though. I think that plan above is a good first step.

@agjohnson agjohnson added this to the Cleanup milestone May 12, 2017
@agjohnson agjohnson added the Improvement Minor improvement to code label May 12, 2017
@agjohnson
Copy link
Contributor

I believe this is can be closed as these issues were dealt with during our linting upgrade at pycon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Minor improvement to code
Projects
None yet
Development

No branches or pull requests

2 participants