forked from mirror/logrus
Call entry.String() directly.
This commit is contained in:
parent
ffc6dc63ef
commit
491a120617
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue