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

Fix unstructured logging variable formatting #2025

Open
melange396 opened this issue Aug 15, 2024 · 2 comments
Open

Fix unstructured logging variable formatting #2025

melange396 opened this issue Aug 15, 2024 · 2 comments
Assignees
Labels
bug Something isn't working devops enhancement future-solution Solutions to problems we don't have yet but still dread

Comments

@melange396
Copy link
Contributor

We use a logger in a lot of places in this repo, which is good! To make this structured logging as useful as it can be, the event argument (usually the first unnamed arg) should be a static string (to filter more easily), and each dynamic/varying value should be specified in an individual named argument to the logger call. Much of the logging usage here follows those rules, but not all -- among other reasons, i think a lot came from when we ported to more proper logging from dumb print() statements that had variables inserted mid-string and we didnt fix the format.

As of right now, these are the files that seem to have the less-desired usage:

@melange396 melange396 added bug Something isn't working enhancement future-solution Solutions to problems we don't have yet but still dread devops labels Aug 15, 2024
@aysim319
Copy link
Contributor

Ah I didn't know that! Do we have a space/documentation/reference for best practices like these?

@aysim319
Copy link
Contributor

#2029 (review)

Note: need to comeback once #1268 is finished

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working devops enhancement future-solution Solutions to problems we don't have yet but still dread
Projects
None yet
Development

No branches or pull requests

2 participants