Merge pull request #860 from xrstf/master

Fix hook example
This commit is contained in:
David Bariod
2018-11-16 14:29:20 +01:00
committed by GitHub
+1 -1
View File
@@ -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