From a5a1406a0b300e1e4ebc543b3c461c73ec4f0156 Mon Sep 17 00:00:00 2001 From: Stian Grindvoll Date: Fri, 31 Aug 2018 14:46:07 +0200 Subject: [PATCH] Show only interval stats log during debug Displaying this log generates a lot of noise in centralized logging when using multiple instances of statsdaemon. --- statsdaemon.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/statsdaemon.go b/statsdaemon.go index a4d24e6..516c928 100644 --- a/statsdaemon.go +++ b/statsdaemon.go @@ -244,7 +244,9 @@ func submit(deadline time.Time) error { return errors.New(errmsg) } - log.Printf("sent %d stats to %s", num, *graphiteAddress) + if *debug { + log.Printf("sent %d stats to %s", num, *graphiteAddress) + } return nil }