Open jeffmendoza opened 4 months ago
I recommend something like this: https://pkg.go.dev/github.com/hashicorp/go-retryablehttp#LeveledLogger
The standard library also has a structured logging library now too :)
Looks like the linked interface would work directly with a https://pkg.go.dev/log/slog@go1.22.5#Logger or a https://pkg.go.dev/go.uber.org/zap#SugaredLogger among others.
This issue has been marked stale because it has been open for 60 days with no activity.
Is your feature request related to a problem? Please describe. Describe the solution you'd like
In order to use structured logging and add additional key/values, scorecard.Run() should take a logger interface (of it's own design) and use that for logging.
I recommend something like this: https://pkg.go.dev/github.com/hashicorp/go-retryablehttp#LeveledLogger That can be implemented by any number of popular loggers, then the calling program can decide what to log or configure the level of the underlying logger.
Describe alternatives you've considered The logging level is good, but still logs in unstructured format