Browse Source

fix hook example

tags/v1.3.0
xrstf 1 year ago
parent
commit
eab2c444ac
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      example_hook_test.go

+ 1
- 1
example_hook_test.go View File

@@ -16,7 +16,7 @@ func Example_hook() {
16 16
 	log.Formatter = new(logrus.TextFormatter)                     // default
17 17
 	log.Formatter.(*logrus.TextFormatter).DisableColors = true    // remove colors
18 18
 	log.Formatter.(*logrus.TextFormatter).DisableTimestamp = true // remove timestamp from test output
19
-	if sl, err := slhooks.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, ""); err != nil {
19
+	if sl, err := slhooks.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, ""); err == nil {
20 20
 		log.Hooks.Add(sl)
21 21
 	}
22 22
 	log.Out = os.Stdout

Loading…
Cancel
Save