Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
Properly pass variadic args to log module
Browse files Browse the repository at this point in the history
  • Loading branch information
wtait1 committed Mar 28, 2020
1 parent ba2be85 commit f36c587
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ func logErr(err error) {

func logWarn(msg string, v ...interface{}) {
if len(v) > 0 {
log.Printf("[WARN] "+msg+"\n", v)
println(msg)
log.Printf("[WARN] "+msg+"\n", v...)
} else {
log.Printf("[WARN] " + msg + "\n")
}
Expand All @@ -64,7 +65,7 @@ func logWarn(msg string, v ...interface{}) {
func logDebug(msg string, v ...interface{}) {
if flags.debug {
if len(v) > 0 {
log.Printf("[DEBUG] "+msg+"\n", v)
log.Printf("[DEBUG] "+msg+"\n", v...)
} else {
log.Printf("[DEBUG] " + msg + "\n")
}
Expand Down

0 comments on commit f36c587

Please sign in to comment.