This commit is contained in:
Mark Phelps 2020-04-16 11:13:51 -04:00
parent d417be0fe6
commit 03155c5499
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})