logrus
logrus copied to clipboard
Entry.WithFields(): copy the original entry
Entry.WithFields()
currently creates a new Entry
and partially copies it. Calling several times WithFields()
on an already logged entry (e.g. in a formatter) thus leads to an incorrectly initialized Entry
structure.
The patch makes the method copy the original entry and only modify the Data
member with the new set of fields. So that calling several times WithFields()
on an already logged entry
(e.g. in a formatter Format()
method) avoids this problem.
We should probably fix #529 first because merging this will cause race detector to go nuts.