From 9732c0575698d3b59cc991f539df287394f1b6fe Mon Sep 17 00:00:00 2001 From: Adam Butler Date: Sun, 26 Jul 2026 19:49:14 +1000 Subject: [PATCH] edac: Fix printf-style formatting in slog call The Debug call added in #3734 passes printf verbs and positional arguments to slog, which does not format them. The format string is logged verbatim and the arguments are consumed as key/value pairs, so controller and channel numbers become attribute keys: a duplicate key when the two are equal, and otherwise a key whose name changes on every iteration. Under --log.format=json that is an object with a repeated key, and parsers silently drop one of the values. The csrow number and the error, the two things worth reading, are the only parts that survive, and they appear as values of meaningless keys. %w compounds it: that is an fmt.Errorf directive and not a valid Printf verb, left behind when the error return this replaced was converted to a log line. Pass the values as named attributes instead. Metric output is unchanged. Signed-off-by: Adam Butler --- collector/edac_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collector/edac_linux.go b/collector/edac_linux.go index 784d8c1095..f5f95c2075 100644 --- a/collector/edac_linux.go +++ b/collector/edac_linux.go @@ -201,7 +201,7 @@ func (c *edacCollector) Update(ch chan<- prometheus.Metric) error { label, ) } else { - c.logger.Debug("couldn't get ue_count for controller/csrow/channel %s/%s/%s: %w", controllerNumber, csrowNumber, channelNumber, err) + c.logger.Debug("couldn't get ue_count", "controller", controllerNumber, "csrow", csrowNumber, "channel", channelNumber, "err", err) } } }