Skip to content

Commit 7a65016

Browse files
committed
tech(log): fixes extra param logging
1 parent 10e63e5 commit 7a65016

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

pkg/log/log.go

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,29 @@ func Debug2(message string, v ...interface{}) {
5858
}
5959

6060
func Info(format string, v ...interface{}) {
61-
Root.Info(fmt.Sprintf(format, v))
61+
var message string
62+
if len(v) > 0 {
63+
message = fmt.Sprintf(format, v)
64+
} else {
65+
message = format
66+
}
67+
68+
Root.Info(message)
6269
}
6370

6471
func Info2(message string, v ...interface{}) {
6572
Root.Info(message, v...)
6673
}
6774

6875
func Warn(format string, v ...interface{}) {
69-
Root.Warn(fmt.Sprintf(format, v))
76+
var message string
77+
if len(v) > 0 {
78+
message = fmt.Sprintf(format, v)
79+
} else {
80+
message = format
81+
}
82+
83+
Root.Warn(message)
7084
}
7185

7286
func Warn2(message string, v ...interface{}) {

0 commit comments

Comments
 (0)