Skip to content

Commit

Permalink
cleaned up logging
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph committed Mar 1, 2021
1 parent 86c635c commit f3dce5d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions health/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ type checkListener struct {
}

func (c *checkListener) OnCheckStarted(name string) {
c.log.Debug("starting to run health check %s", name)
c.log.Debug("starting to run %s", name)
}
func (c *checkListener) OnCheckCompleted(name string, result health.Result) {
resultJSON, err := json.Marshal(result)
if err != nil {
c.log.Error("failed to encode health check %q when it was failing due to: %s", name, err)
c.log.Error("failed to encode %q when it was failing due to: %s", name, err)
return
}

Expand All @@ -97,16 +97,16 @@ func (c *checkListener) OnCheckCompleted(name string, result health.Result) {

if !exists || isHealthy == previouslyHealthy {
if isHealthy {
c.log.Debug("health check %q returned healthy with: %s", name, string(resultJSON))
c.log.Debug("%q returned healthy with: %s", name, string(resultJSON))
} else {
c.log.Debug("health check %q returned unhealthy with: %s", name, string(resultJSON))
c.log.Debug("%q returned unhealthy with: %s", name, string(resultJSON))
}
return
}

if isHealthy {
c.log.Info("health check %q became healthy with: %s", name, string(resultJSON))
c.log.Info("%q became healthy with: %s", name, string(resultJSON))
} else {
c.log.Warn("health check %q became unhealthy with: %s", name, string(resultJSON))
c.log.Warn("%q became unhealthy with: %s", name, string(resultJSON))
}
}

0 comments on commit f3dce5d

Please sign in to comment.