Commit 1611f1da by feidy

update logger

parent 0603f3c6
......@@ -36,7 +36,7 @@ type loggerConfig struct {
MaxBackups int
MaxAge int
Compress bool
Ostd bool
Console bool
}
type loggerOption func(m *loggerConfig)
......@@ -77,9 +77,9 @@ func WithCompress(compress bool) loggerOption {
}
}
func WithOstd(isOstd bool) loggerOption {
func WithWithConsole(isConsole bool) loggerOption {
return func(m *loggerConfig) {
m.Ostd = isOstd
m.Console = isConsole
}
}
......@@ -103,7 +103,7 @@ func InitLogger(opt ...loggerOption) {
writeSync := getLogWriter()
encoder := getEncoder()
var core zapcore.Core
if lf.Ostd {
if lf.Console {
consoleDebugging := zapcore.Lock(os.Stdout)
core = zapcore.NewTee(
zapcore.NewCore(encoder, writeSync, zapcore.Level(lf.Level)),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment