Sfoglia il codice sorgente

fix bug in log sprintf calls (#8124)

Dan Cech 8 anni fa
parent
commit
3a607f96a3
1 ha cambiato i file con 6 aggiunte e 6 eliminazioni
  1. 6 6
      pkg/log/log.go

+ 6 - 6
pkg/log/log.go

@@ -34,7 +34,7 @@ func New(logger string, ctx ...interface{}) Logger {
 func Trace(format string, v ...interface{}) {
 func Trace(format string, v ...interface{}) {
 	var message string
 	var message string
 	if len(v) > 0 {
 	if len(v) > 0 {
-		message = fmt.Sprintf(format, v)
+		message = fmt.Sprintf(format, v...)
 	} else {
 	} else {
 		message = format
 		message = format
 	}
 	}
@@ -45,7 +45,7 @@ func Trace(format string, v ...interface{}) {
 func Debug(format string, v ...interface{}) {
 func Debug(format string, v ...interface{}) {
 	var message string
 	var message string
 	if len(v) > 0 {
 	if len(v) > 0 {
-		message = fmt.Sprintf(format, v)
+		message = fmt.Sprintf(format, v...)
 	} else {
 	} else {
 		message = format
 		message = format
 	}
 	}
@@ -60,7 +60,7 @@ func Debug2(message string, v ...interface{}) {
 func Info(format string, v ...interface{}) {
 func Info(format string, v ...interface{}) {
 	var message string
 	var message string
 	if len(v) > 0 {
 	if len(v) > 0 {
-		message = fmt.Sprintf(format, v)
+		message = fmt.Sprintf(format, v...)
 	} else {
 	} else {
 		message = format
 		message = format
 	}
 	}
@@ -75,7 +75,7 @@ func Info2(message string, v ...interface{}) {
 func Warn(format string, v ...interface{}) {
 func Warn(format string, v ...interface{}) {
 	var message string
 	var message string
 	if len(v) > 0 {
 	if len(v) > 0 {
-		message = fmt.Sprintf(format, v)
+		message = fmt.Sprintf(format, v...)
 	} else {
 	} else {
 		message = format
 		message = format
 	}
 	}
@@ -88,7 +88,7 @@ func Warn2(message string, v ...interface{}) {
 }
 }
 
 
 func Error(skip int, format string, v ...interface{}) {
 func Error(skip int, format string, v ...interface{}) {
-	Root.Error(fmt.Sprintf(format, v))
+	Root.Error(fmt.Sprintf(format, v...))
 }
 }
 
 
 func Error2(message string, v ...interface{}) {
 func Error2(message string, v ...interface{}) {
@@ -96,7 +96,7 @@ func Error2(message string, v ...interface{}) {
 }
 }
 
 
 func Critical(skip int, format string, v ...interface{}) {
 func Critical(skip int, format string, v ...interface{}) {
-	Root.Crit(fmt.Sprintf(format, v))
+	Root.Crit(fmt.Sprintf(format, v...))
 }
 }
 
 
 func Fatal(skip int, format string, v ...interface{}) {
 func Fatal(skip int, format string, v ...interface{}) {