Skip to content

Commit 38bc297

Browse files
committed
return new entry for Entry.WithContext
1 parent aefd7ec commit 38bc297

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

entry.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ func (entry *Entry) WithError(err error) *Entry {
103103

104104
// Add a context to the Entry.
105105
func (entry *Entry) WithContext(ctx context.Context) *Entry {
106-
entry.Context = ctx
107-
return entry
106+
return &Entry{Logger: entry.Logger, Data: entry.Data, Time: entry.Time, err: entry.err, Context: ctx}
108107
}
109108

110109
// Add a single field to the Entry.

0 commit comments

Comments
 (0)