diff --git a/lib/autoupdate/agent/logger.go b/lib/autoupdate/agent/logger.go index 41333d96729cd..bd50ee50859a4 100644 --- a/lib/autoupdate/agent/logger.go +++ b/lib/autoupdate/agent/logger.go @@ -46,8 +46,10 @@ type progressLogger struct { func (w *progressLogger) Write(p []byte) (n int, err error) { w.n += len(p) if w.n >= w.max*(w.l+1)/w.lines { - msg := fmt.Sprintf("%s - progress: %d%%", w.name, w.n*100/w.max) - w.log.Log(w.ctx, w.level, msg) //nolint:sloglint // msg cannot be constant + w.log.Log(w.ctx, w.level, "Downloading", + "file", w.name, + "progress", fmt.Sprintf("%d%%", w.n*100/w.max), + ) w.l++ } return len(p), nil diff --git a/lib/autoupdate/agent/logger_test.go b/lib/autoupdate/agent/logger_test.go index 9eec9348c7b60..2a8430ef8cf44 100644 --- a/lib/autoupdate/agent/logger_test.go +++ b/lib/autoupdate/agent/logger_test.go @@ -177,7 +177,7 @@ func TestProgressLogger(t *testing.T) { v, err := io.ReadAll(out) require.NoError(t, err) if len(v) > 0 { - e.out = fmt.Sprintf(`msg="test - progress: %s"`+"\n", e.out) + e.out = fmt.Sprintf(`msg=Downloading file=test progress=%s`+"\n", e.out) } require.Equal(t, e.out, string(v)) }