Skip to content

Commit

Permalink
Update bridges/otelzap/core.go
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Pająk <pellared@hotmail.com>
  • Loading branch information
khushijain21 and pellared authored Jun 3, 2024
1 parent b4c8425 commit 5e20a77
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bridges/otelzap/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ func (o *Core) Enabled(level zapcore.Level) bool {
func (o *Core) With(fields []zapcore.Field) zapcore.Core {
cloned := o.clone()
if len(fields) > 0 {
var attrbuf []log.KeyValue
cloned.ctx, attrbuf = convertField(cloned.ctx, fields)
ctx, attrbuf := convertField(fields)
if ctx != nil {
cloned.ctx = ctx
}
cloned.attr = append(cloned.attr, attrbuf...)
}
return cloned
Expand Down

0 comments on commit 5e20a77

Please sign in to comment.