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

Let the logger format the message lazily. #700

Merged
merged 3 commits into from
Mar 5, 2021
Merged

Let the logger format the message lazily. #700

merged 3 commits into from
Mar 5, 2021

Conversation

Jean-Daniel
Copy link
Contributor

Using format() for logger is discouraged as it forces the message to format the message even when log are disabled.

Moreover, the .format vs %s is used inconsistently all over the codebase.
Switching all usages to the logger builtin formatting make the code more consistent.

Proposed Changes

  • convert all usage of format() to format logging message to use the builtin logging formatter instead.

Using format for logger is discouraged as it forces the message to format the message even when log are disabled.
@ademariag
Copy link
Contributor

Thank you for yet another contribution @Jean-Daniel . Join our slack channel on kubernetes slack (https://slack.k8s.io/) if you can!

kapitan/resources.py Outdated Show resolved Hide resolved
Copy link
Member

@ramaro ramaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @Jean-Daniel - just one tiny comment to change.

@ramaro ramaro merged commit ae655d2 into kapicorp:master Mar 5, 2021
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.

3 participants