go日志
// log package log //cxg 2022-7-29 import ( "log" "os" "time" ) func GetCurDay() string { return time.Now().Format("2006-01-02") } func GetNow() string { return time.Now().Format("2006-01-02 15:04:05") } func Log(a ...interface{}) { logFile, err := os.OpenFile(GetCurDay()+".log", os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0666) if err != nil { panic(err) return } log.SetOutput(logFile) // 设置存储位置 log.Println(a...) }