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

Delay string formatting when logging messages #227

Merged
merged 2 commits into from Jan 31, 2019

Conversation

Projects
None yet
2 participants
@c-w
Copy link
Member

commented Jan 31, 2019

If we pass format strings and format arguments to the Python standard library logger, it can determine whether the logger currently is enabled and save a string interpolation if the message anyways wouldn't be logged.

All Submissions:

  • Have you followed the guidelines in our Contributing document?

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

  • Does your PR follow our Code of Conduct?

  • Have you added an explanation of what your changes do and why you'd like us to include them?

  • Does each method or function "do one thing well"? Reviewers may recommend methods be split up for maintainability and testability.

  • Is this code designed to be testable?

  • Is the code documented well?

  • Does your submission pass existing tests (or update existing tests with documentation regarding the change)?

  • Have you added tests to cover your changes?

  • Have you linted your code prior to submission?

  • Have you updated the documentation and README? Not applicable

  • Is PII treated correctly? In particular, make sure the code is not logging objects or strings that might contain PII (e.g. request headers). Not applicable

  • Have secrets been stripped before committing? Not applicable

@c-w c-w force-pushed the fix-logging branch from c77eb72 to 4c41914 Jan 31, 2019

@sayar

sayar approved these changes Jan 31, 2019

Copy link
Collaborator

left a comment

👍

@c-w c-w force-pushed the fix-logging branch from 4c41914 to 7ff1ca8 Jan 31, 2019

Delay string formatting when logging messages
If we pass format strings and format arguments to the Python standard
library logger, it can determine whether the logger currently is enabled
and save a string interpolation if the message anyways wouldn't be
logged.

@c-w c-w force-pushed the fix-logging branch from 7ff1ca8 to 8dbcf8d Jan 31, 2019

@c-w c-w force-pushed the fix-logging branch from 8dbcf8d to 9ea51d9 Jan 31, 2019

@c-w c-w merged commit 0ac8c27 into master Jan 31, 2019

2 checks passed

agogosml-ci Build #20190131.15 succeeded
Details
license/cla All CLA requirements met.
Details

@c-w c-w deleted the fix-logging branch Jan 31, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.