Merge pull request #1131 from sirupsen/revert-1047

Revert #1047
This commit is contained in:
Mark Phelps 2020-04-16 11:24:31 -04:00 committed by GitHub
commit 91ef3ab5d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 3 deletions

View File

@ -122,8 +122,6 @@ func (entry *Entry) WithField(key string, value interface{}) *Entry {
// Add a map of fields to the Entry.
func (entry *Entry) WithFields(fields Fields) *Entry {
entry.Logger.mu.Lock()
defer entry.Logger.mu.Unlock()
data := make(Fields, len(entry.Data)+len(fields))
for k, v := range entry.Data {
data[k] = v

View File

@ -210,7 +210,7 @@ func TestEntryWithIncorrectField(t *testing.T) {
fn := func() {}
e := &Entry{Logger: New()}
e := Entry{}
eWithFunc := e.WithFields(Fields{"func": fn})
eWithFuncPtr := e.WithFields(Fields{"funcPtr": &fn})