From 03155c54997ab8de79233f66295f0cd0a4a19b25 Mon Sep 17 00:00:00 2001 From: Mark Phelps Date: Thu, 16 Apr 2020 11:13:51 -0400 Subject: [PATCH] Revert #1047 --- entry.go | 2 -- entry_test.go | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/entry.go b/entry.go index 27b14bf..f6e062a 100644 --- a/entry.go +++ b/entry.go @@ -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 diff --git a/entry_test.go b/entry_test.go index 30eddae..b98e14a 100644 --- a/entry_test.go +++ b/entry_test.go @@ -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})