فهرست منبع

Fix incorrect usage of logrus when formatting string is present

This fix tries to fix logrus formatting by adding `f` to the end of
`logrus.[Error|Warn|Debug|Fatal|Panic|Info](` when formatting string
is present but the function `logrus.[Error|Warn|Debug|Fatal|Panic|Info](`
is used (incorrectly).

This fix is related to #23459, and is a follow up of #23461.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Yong Tang 9 سال پیش
والد
کامیت
d917723331
2فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 1 1
      daemon/daemon_unix.go
  2. 1 1
      integration-cli/events_utils.go

+ 1 - 1
daemon/daemon_unix.go

@@ -362,7 +362,7 @@ func verifyContainerResources(resources *containertypes.Resources, sysInfo *sysi
 	}
 	if resources.CPUPercent > 0 {
 		warnings = append(warnings, "%s does not support CPU percent. Percent discarded.", runtime.GOOS)
-		logrus.Warn("%s does not support CPU percent. Percent discarded.", runtime.GOOS)
+		logrus.Warnf("%s does not support CPU percent. Percent discarded.", runtime.GOOS)
 		resources.CPUPercent = 0
 	}
 

+ 1 - 1
integration-cli/events_utils.go

@@ -89,7 +89,7 @@ func (e *eventObserver) Match(match eventMatcher, process eventMatchProcessor) {
 		err = io.EOF
 	}
 
-	logrus.Debug("EventObserver scanner loop finished: %v", err)
+	logrus.Debugf("EventObserver scanner loop finished: %v", err)
 	e.disconnectionError = err
 }