fix clone #114

Merged
vtolstov merged 1 commits from cloenfix into v3 2023-11-03 16:18:00 +03:00

View File

@ -29,11 +29,13 @@ func (l *zeroLogger) Level(lvl logger.Level) {
} }
func (l *zeroLogger) Clone(opts ...logger.Option) logger.Logger { 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 { 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() _ = nl.Init()
return nl return nl
} }