Merge pull request #941 from hrxu01/return_new_entry_for_Entry.WithContext

return new entry for Entry.WithContext
This commit is contained in:
Adam Renberg Tamm 2019-03-31 15:19:41 +02:00 committed by GitHub
commit a6c0064cfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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. // Add a context to the Entry.
func (entry *Entry) WithContext(ctx context.Context) *Entry { func (entry *Entry) WithContext(ctx context.Context) *Entry {
entry.Context = ctx return &Entry{Logger: entry.Logger, Data: entry.Data, Time: entry.Time, err: entry.err, Context: ctx}
return entry
} }
// Add a single field to the Entry. // Add a single field to the Entry.