Clean up logging (#3161)

- use `Err` method instead of format strings
- use `Msg` if no format string is used
This commit is contained in:
qwerty287
2024-01-10 20:57:12 +01:00
committed by GitHub
parent 12c40eb957
commit 00df53e941
20 changed files with 47 additions and 47 deletions

View File

@@ -62,7 +62,7 @@ func run(c *cli.Context) error {
if c.Bool("healthcheck") {
go func() {
if err := http.ListenAndServe(c.String("healthcheck-addr"), nil); err != nil {
log.Error().Msgf("cannot listen on address %s: %v", c.String("healthcheck-addr"), err)
log.Error().Err(err).Msgf("cannot listen on address %s", c.String("healthcheck-addr"))
}
}()
}
@@ -210,7 +210,7 @@ func run(c *cli.Context) error {
err := client.ReportHealth(ctx)
if err != nil {
log.Err(err).Msgf("Failed to report health")
log.Err(err).Msg("Failed to report health")
return
}