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 messages should use arguments rather than fully-formatted strings #80

Closed
lbernick opened this issue Sep 16, 2019 · 2 comments
Closed

Comments

@lbernick
Copy link
Contributor

Hello! My organization is using backoff version 1.8.0, and would benefit from having log messages pass variable data in as arguments (e.g. logger.error("Foo: %s", "bar")) rather than logging fully formatted strings (e.g. logger.error("Foo: {}".format("bar"))). This style of logging is recommended by the python docs because it allows log sinks to process log messages in a more meaningful way. Specifically, my organization uses Sentry, which will understand that multiple calls with the same log message but different arguments represent different incidents of the same issue, but can't recognize logs as related to the same issue if arguments are pre-formatted before the string is logged. I am happy to make a pull request for this if you would like.

@bgreen-litl
Copy link
Member

Sorry for the slow response. If you make a pull request for this I'll take a look at it. As long as this doesn't break existing code or logging behavior (I think it shouldn't) then it should be okay.

Also any changes need to work in Python 2.7, 3.5, 3.6, 3.7 (and probably 3.8).

Thanks!

@bgreen-litl
Copy link
Member

bgreen-litl commented Oct 11, 2019

PR #82 is merged and is included in backoff==1.8.1! Thanks for this.

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

No branches or pull requests

2 participants