grafana / cloudcost-exporter

Prometheus Exporter for Cloud Provider agnostic cost metrics
Apache License 2.0
30 stars 1 forks source link

feat(logger): Convert to using slog #188

Closed Pokom closed 3 months ago

Pokom commented 4 months ago

This introduces using slog as a structured logger for the project. Created a LevelHandler struct that is responsible for only logging out messages below a configured log level. Extended the config object to have a Log configuration to set

Added the following command flags:

Updated the csp and collector entrypoints to have accept a *slog.Logger parameter. Started updating existing log.Printf statements to use appropriate logging.

TODO:

Pokom commented 3 months ago

I'm going to close this PR in favor of breaking this up into smaller chunks. I'll keep the branch around temporarily as I use it for reference