Skip to content

Commit

Permalink
Merge pull request sirupsen#941 from hrxu01/return_new_entry_for_Entr…
Browse files Browse the repository at this point in the history
…y.WithContext

return new entry for Entry.WithContext
  • Loading branch information
tgwizard committed Mar 31, 2019
2 parents c9b1473 + 224112b commit 42ab765
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions entry.go
Expand Up @@ -103,8 +103,7 @@ func (entry *Entry) WithError(err error) *Entry {

// Add a context to the Entry.
func (entry *Entry) WithContext(ctx context.Context) *Entry {
entry.Context = ctx
return entry
return &Entry{Logger: entry.Logger, Data: entry.Data, Time: entry.Time, err: entry.err, Context: ctx}
}

// Add a single field to the Entry.
Expand Down

0 comments on commit 42ab765

Please sign in to comment.