Просмотр исходного кода

fix formatting for deduplicated log messages (#2767)

Signed-off-by: Reinier Schoof <reinier@skoef.nl>
Co-authored-by: Alex Meijer <ameijer@users.noreply.github.com>
Reinier Schoof 1 год назад
Родитель
Сommit
19ef007b3d
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      core/pkg/log/log.go

+ 3 - 3
core/pkg/log/log.go

@@ -76,7 +76,7 @@ func DedupedErrorf(logTypeLimit int, format string, a ...interface{}) {
 		Errorf(format, a...)
 	} else if timesLogged == logTypeLimit {
 		Errorf(format, a...)
-		Infof("%s logged %d times: suppressing future logs", format, logTypeLimit)
+		Infof("%s logged %d times: suppressing future logs", fmt.Sprintf(format, a...), logTypeLimit)
 	}
 }
 
@@ -91,7 +91,7 @@ func DedupedWarningf(logTypeLimit int, format string, a ...interface{}) {
 		Warnf(format, a...)
 	} else if timesLogged == logTypeLimit {
 		Warnf(format, a...)
-		Infof("%s logged %d times: suppressing future logs", format, logTypeLimit)
+		Infof("%s logged %d times: suppressing future logs", fmt.Sprintf(format, a...), logTypeLimit)
 	}
 }
 
@@ -110,7 +110,7 @@ func DedupedInfof(logTypeLimit int, format string, a ...interface{}) {
 		Infof(format, a...)
 	} else if timesLogged == logTypeLimit {
 		Infof(format, a...)
-		Infof("%s logged %d times: suppressing future logs", format, logTypeLimit)
+		Infof("%s logged %d times: suppressing future logs", fmt.Sprintf(format, a...), logTypeLimit)
 	}
 }