mirror of https://github.com/sirupsen/logrus.git
Merge pull request #84 from vincentbernat/fix/syslog
syslog: let syslog output lookup level directly in Entry struct
This commit is contained in:
commit
1f2ba2c631
|
@ -29,18 +29,18 @@ func (hook *SyslogHook) Fire(entry *logrus.Entry) error {
|
|||
return err
|
||||
}
|
||||
|
||||
switch entry.Data["level"] {
|
||||
case "panic":
|
||||
switch entry.Level {
|
||||
case logrus.PanicLevel:
|
||||
return hook.Writer.Crit(line)
|
||||
case "fatal":
|
||||
case logrus.FatalLevel:
|
||||
return hook.Writer.Crit(line)
|
||||
case "error":
|
||||
case logrus.ErrorLevel:
|
||||
return hook.Writer.Err(line)
|
||||
case "warn":
|
||||
case logrus.WarnLevel:
|
||||
return hook.Writer.Warning(line)
|
||||
case "info":
|
||||
case logrus.InfoLevel:
|
||||
return hook.Writer.Info(line)
|
||||
case "debug":
|
||||
case logrus.DebugLevel:
|
||||
return hook.Writer.Debug(line)
|
||||
default:
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue