package log import ( "go.uber.org/zap" "go.uber.org/zap/zapcore" "gopkg.in/natefinch/lumberjack.v2" "os" "time" ) func NewLog(console, env, lv, lp string) *zap.Logger { //目录不存在则创建 if _, err := os.Stat(lp); err != nil { err := os.MkdirAll(lp, os.ModePerm) if err != nil { panic(err) } } var level zapcore.Level //debug