Skip to content

Commit

Permalink
Remove unused hook field on event
Browse files Browse the repository at this point in the history
  • Loading branch information
rs committed Sep 19, 2018
1 parent 624b311 commit 972f271
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions event.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ type Event struct {
level Level
done func(msg string)
ch []Hook // hooks from context
h []Hook
}

// LogObjectMarshaler provides a strongly-typed and encoding-agnostic interface
Expand All @@ -49,7 +48,7 @@ type LogArrayMarshaler interface {
func newEvent(w LevelWriter, level Level) *Event {
e := eventPool.Get().(*Event)
e.buf = e.buf[:0]
e.h = e.h[:0]
e.ch = nil
e.buf = enc.AppendBeginMarker(e.buf)
e.w = w
e.level = level
Expand Down Expand Up @@ -114,14 +113,6 @@ func (e *Event) msg(msg string) {
}
}
}
if len(e.h) > 0 {
e.h[0].Run(e, e.level, msg)
if len(e.h) > 1 {
for _, hook := range e.h[1:] {
hook.Run(e, e.level, msg)
}
}
}
if msg != "" {
e.buf = enc.AppendString(enc.AppendKey(e.buf, MessageFieldName), msg)
}
Expand Down

0 comments on commit 972f271

Please sign in to comment.