modify NewLogger, add example
This commit is contained in:
parent
bcd0f31019
commit
f95dfe1666
|
@ -46,7 +46,7 @@ type Logger struct {
|
|||
initialized bool
|
||||
}
|
||||
|
||||
func NewLogger(mod ...ModOptions) *zap.Logger {
|
||||
func NewLogger(mod ...ModOptions) *Logger {
|
||||
logger = &Logger{}
|
||||
logger.Lock()
|
||||
defer logger.Unlock()
|
||||
|
@ -90,7 +90,7 @@ func NewLogger(mod ...ModOptions) *zap.Logger {
|
|||
logger.zapConfig.Level.SetLevel(logger.Opts.Level)
|
||||
logger.init()
|
||||
logger.initialized = true
|
||||
return logger.Logger
|
||||
return logger
|
||||
}
|
||||
|
||||
func (logger *Logger) init() {
|
||||
|
|
Loading…
Reference in New Issue