From 00391816af3d93faae1ba90eabdfbc39af4da655 Mon Sep 17 00:00:00 2001 From: Rich Unger Date: Thu, 11 Jan 2024 15:05:13 -0800 Subject: [PATCH 1/2] Reduce log spam The flushing log line spews lots of logs and doesn't provide that much value. --- logging_sink.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logging_sink.go b/logging_sink.go index b4c35f4..135a9cf 100644 --- a/logging_sink.go +++ b/logging_sink.go @@ -79,7 +79,7 @@ func (s *loggingSink) log(name, typ string, value float64) { } enc.Encode(logLine{ Message: fmt.Sprintf("flushing %s", typ), - Level: "info", + Level: "debug", Timestamp: sec, Logger: "gostats.loggingsink", JSON: kv, From 327c3ce3134a20dde85c0affdf47da95c12f71aa Mon Sep 17 00:00:00 2001 From: Rich Unger Date: Thu, 11 Jan 2024 15:11:06 -0800 Subject: [PATCH 2/2] test update --- logging_sink_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logging_sink_test.go b/logging_sink_test.go index 736baf3..36acfc1 100644 --- a/logging_sink_test.go +++ b/logging_sink_test.go @@ -8,5 +8,5 @@ func Example_flushCounter() { l := &loggingSink{writer: os.Stdout, now: foreverNow} l.FlushCounter("counterName", 420) // Output: - // {"level":"info","ts":1640995200.000000,"logger":"gostats.loggingsink","msg":"flushing counter","json":{"name":"counterName","type":"counter","value":"420.000000"}} + // {"level":"debug","ts":1640995200.000000,"logger":"gostats.loggingsink","msg":"flushing counter","json":{"name":"counterName","type":"counter","value":"420.000000"}} }