diff --git a/knife/logger.go b/knife/logger.go index 8d52062..31c98f7 100644 --- a/knife/logger.go +++ b/knife/logger.go @@ -3,6 +3,19 @@ package knife import ( "log" "os" + "time" ) -var Logger = log.New(os.Stdout, "", log.LstdFlags) +var Logger = newLogger() + +type loggers struct { + *log.Logger +} + +func newLogger() *loggers { + now := time.Now().Format("2006-01-02 15:04:05.000") + l := log.New(os.Stdout, now+" ", log.Lshortfile) + return &loggers{ + Logger: l, + } +}