return new entry for Entry.WithContext

This commit is contained in:
Haoran Xu 2019-03-29 14:04:26 +08:00
parent aefd7ecb90
commit 38bc297a3d
1 changed files with 1 additions and 2 deletions

View File

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