Call entry.String() directly.

This commit is contained in:
Didip Kerabat 2014-07-27 22:04:55 -07:00
parent ffc6dc63ef
commit 491a120617
1 changed files with 1 additions and 3 deletions

View File

@ -23,14 +23,12 @@ func NewSyslogHook(network, raddr string, priority syslog.Priority, tag string)
} }
func (hook *SyslogHook) Fire(entry *logrus.Entry) error { func (hook *SyslogHook) Fire(entry *logrus.Entry) error {
reader, err := entry.Reader() line, err := entry.String()
if err != nil { if err != nil {
fmt.Fprintf(os.Stderr, "Unable to read entry, %v", err) fmt.Fprintf(os.Stderr, "Unable to read entry, %v", err)
return err return err
} }
line := reader.String()
switch entry.Data["level"] { switch entry.Data["level"] {
case "panic": case "panic":
return hook.Writer.Crit(line) return hook.Writer.Crit(line)