Skip to content

Commit

Permalink
Merge pull request #15 from BadKid90s/logger
Browse files Browse the repository at this point in the history
fix(main): 修复日志记录时间不对的BUG
  • Loading branch information
BadKid90s authored Jan 29, 2024
2 parents eb8b3f4 + 5e845dd commit 372b79a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion knife/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

0 comments on commit 372b79a

Please sign in to comment.