Merge pull request 'fix clone' (#114) from cloenfix into v3
Reviewed-on: #114
This commit is contained in:
commit
b91363711d
@ -29,11 +29,13 @@ func (l *zeroLogger) Level(lvl logger.Level) {
|
||||
}
|
||||
|
||||
func (l *zeroLogger) Clone(opts ...logger.Option) logger.Logger {
|
||||
nl := &zeroLogger{zLog: l.zLog, opts: l.opts}
|
||||
options := l.opts
|
||||
fields := options.Fields
|
||||
for _, o := range opts {
|
||||
o(&nl.opts.Options)
|
||||
o(&options.Options)
|
||||
}
|
||||
nl.opts.Options.Fields = append(l.opts.Options.Fields, nl.opts.Options.Fields...)
|
||||
options.Fields = append(fields, options.Fields...)
|
||||
nl := &zeroLogger{opts: options}
|
||||
_ = nl.Init()
|
||||
return nl
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user