mirror of https://github.com/sirupsen/logrus.git
fix hook example
This commit is contained in:
parent
44067abb19
commit
eab2c444ac
|
@ -16,7 +16,7 @@ func Example_hook() {
|
|||
log.Formatter = new(logrus.TextFormatter) // default
|
||||
log.Formatter.(*logrus.TextFormatter).DisableColors = true // remove colors
|
||||
log.Formatter.(*logrus.TextFormatter).DisableTimestamp = true // remove timestamp from test output
|
||||
if sl, err := slhooks.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, ""); err != nil {
|
||||
if sl, err := slhooks.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, ""); err == nil {
|
||||
log.Hooks.Add(sl)
|
||||
}
|
||||
log.Out = os.Stdout
|
||||
|
|
Loading…
Reference in New Issue