diff --git a/main.go b/main.go index c526517..16276ab 100644 --- a/main.go +++ b/main.go @@ -66,9 +66,11 @@ func errLog(err error) { opsZPosition.Set(0) opsBed.Set(0) opsNozzle.Set(0) - if errCount > 5 { + if errCount == 5 { log.Printf("suppressing further error logging") return + } else if errCount > 5 { + return } log.Printf("error retrieving telemetry: %v", err) } @@ -98,6 +100,9 @@ func recordMetrics(ctx context.Context, config Config) { errLog(err) break } + if errCount != 0 { + log.Printf("connection established") + } errCount = 0 opsFlowFactor.Set(float64(t.FlowFactor)) opsPrintSpeed.Set(float64(t.PrintingSpeed))