diff --git a/zerolog.go b/zerolog.go index 7ecd2d6..29a5bc6 100644 --- a/zerolog.go +++ b/zerolog.go @@ -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 }