We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 915fd28 commit 0351ec2Copy full SHA for 0351ec2
all_packaged_library/logtool/log.go
@@ -63,6 +63,9 @@ func NewLogger(mod ...ModOptions) *zap.Logger {
63
MaxBackups: 60,
64
MaxAge: 30,
65
}
66
+ for _, fn := range mod {
67
+ fn(l.Opts)
68
+ }
69
if l.Opts.LogFileDir == "" {
70
l.Opts.LogFileDir, _ = filepath.Abs(filepath.Dir(filepath.Join(".")))
71
l.Opts.LogFileDir += sp + "logs" + sp
@@ -80,9 +83,6 @@ func NewLogger(mod ...ModOptions) *zap.Logger {
80
83
if l.Opts.ErrorOutputPaths == nil || len(l.Opts.ErrorOutputPaths) == 0 {
81
84
l.zapConfig.OutputPaths = []string{"stderr"}
82
85
- for _, fn := range mod {
- fn(l.Opts)
- }
86
l.zapConfig.Level.SetLevel(l.Opts.Level)
87
l.init()
88
l.inited = true
0 commit comments