Update debug to have timestamps

Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
pull/6337/head
Vibhav Bobade 6 years ago
parent 5bf7ca688f
commit d373b98318

@ -23,6 +23,7 @@ import (
"os" "os"
"strings" "strings"
"sync" "sync"
"time"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/pflag" "github.com/spf13/pflag"
@ -55,7 +56,8 @@ func init() {
func debug(format string, v ...interface{}) { func debug(format string, v ...interface{}) {
if settings.Debug { if settings.Debug {
format = fmt.Sprintf("[debug] %s\n", format) timeNow := time.Now().UTC().String()
format = fmt.Sprintf("%s [debug] %s\n", timeNow, format)
log.Output(2, fmt.Sprintf(format, v...)) log.Output(2, fmt.Sprintf(format, v...))
} }
} }

Loading…
Cancel
Save