We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Since there is a structured logger in the Go stdlib now, we could add something like this to this package too:
package gosundheit import ( "log/slog" health "github.com/AppsFlyer/go-sundheit" ) type checkListener struct { logger *slog.Logger } func NewLogger(logger *slog.Logger) health.CheckListener { return checkListener{ logger: logger, } } func (c checkListener) OnCheckRegistered(name string, result health.Result) { if result.Error != nil { c.logger.Error("initial health check failed", slog.String("check", name), slog.Any("error", result.Error)) return } c.logger.Debug("health check registered", slog.String("check", name)) } func (c checkListener) OnCheckStarted(name string) { c.logger.Debug("starting health check", slog.String("check", name)) } func (c checkListener) OnCheckCompleted(name string, result health.Result) { if result.Error != nil { c.logger.Error("health check failed", slog.String("check", name), slog.Any("error", result.Error)) return } c.logger.Debug("health check completed", slog.String("check", name)) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Since there is a structured logger in the Go stdlib now, we could add something like this to this package too:
The text was updated successfully, but these errors were encountered: