Update frontpage README

This commit is contained in:
Didip Kerabat 2014-07-18 15:47:34 -07:00
parent 58cc2b3fec
commit 24b6c463ab
2 changed files with 4 additions and 1 deletions

View File

@ -148,12 +148,15 @@ Logrus comes with built-in hooks. Add those, or your custom hook, in `init`:
```go
import (
"log/syslog"
"github.com/Sirupsen/logrus"
"github.com/Sirupsen/logrus/hooks/airbrake"
"github.com/Sirupsen/logrus/hooks/syslog"
)
func init() {
log.Hooks.Add(new(logrus_airbrake.AirbrakeHook))
log.Hooks.Add(logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, ""))
}
```

View File

@ -11,7 +11,7 @@ import (
func main() {
log := logrus.New()
hook, err := NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "")
hook, err := logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "")
if err == nil {
log.Hooks.Add(hook)