Open g-k opened 2 years ago
An alternative or additional option, https://github.com/mozilla-services/autograph/pull/782#discussion_r723599970
The logrus readme includes this example:
// A common pattern is to re-use fields between logging statements by re-using
// the logrus.Entry returned from WithFields()
contextLogger := log.WithFields(log.Fields{
"common": "this is a common field",
"other": "I also should be logged always",
})
so that might be an option too. Unless you think it should be addressed in this PR I'll take a TODO and file an issue to clean that up.
This would dedupe some code and standardize the logs a bit more.
nit: Seeing this set of fields in a number of locations, I wonder if this should be moved to a struct that can output a
log.Fields
._Originally posted by @ajvb in https://github.com/mozilla-services/autograph/pull/782#discussion_r723572719_