fix clone
Some checks failed
codeql / analyze (go) (pull_request) Failing after 2m39s
prbuild / test (pull_request) Failing after 1m29s
prbuild / lint (pull_request) Failing after 2m41s
autoapprove / autoapprove (pull_request) Failing after 1m26s
automerge / automerge (pull_request) Failing after 5s
dependabot-automerge / automerge (pull_request) Has been skipped

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2023-11-03 16:17:32 +03:00
parent ea99cc8198
commit 4b742c9cd7

View File

@ -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
}