cmu-delphi / covidcast-indicators

Back end for producing indicators and loading them into the COVIDcast API.
https://cmu-delphi.github.io/delphi-epidata/api/covidcast.html
MIT License
12 stars 17 forks source link

Fix unstructured logging variable formatting #2025

Open melange396 opened 3 weeks ago

melange396 commented 3 weeks ago

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:

aysim319 commented 3 weeks ago

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

aysim319 commented 1 week ago

https://github.com/cmu-delphi/covidcast-indicators/pull/2029#pullrequestreview-2270050125

Note: need to comeback once https://github.com/cmu-delphi/covidcast-indicators/issues/1268 is finished