simplify code of event.msg() (#165)
This commit is contained in:
parent
42d101e9f7
commit
a7f9fc2a17
9
event.go
9
event.go
|
@ -127,13 +127,8 @@ func (e *Event) Msgf(format string, v ...interface{}) {
|
|||
}
|
||||
|
||||
func (e *Event) msg(msg string) {
|
||||
if len(e.ch) > 0 {
|
||||
e.ch[0].Run(e, e.level, msg)
|
||||
if len(e.ch) > 1 {
|
||||
for _, hook := range e.ch[1:] {
|
||||
hook.Run(e, e.level, msg)
|
||||
}
|
||||
}
|
||||
for _, hook := range e.ch {
|
||||
hook.Run(e, e.level, msg)
|
||||
}
|
||||
if msg != "" {
|
||||
e.buf = enc.AppendString(enc.AppendKey(e.buf, MessageFieldName), msg)
|
||||
|
|
Loading…
Reference in New Issue