Merge pull request #152 from burke/bugsnag-hook

hooks: Add BugSnag hook
This commit is contained in:
Simon Eskildsen
2015-03-19 11:23:38 -04:00
3 changed files with 138 additions and 0 deletions
+6
View File
@@ -74,6 +74,7 @@ import (
"os"
log "github.com/Sirupsen/logrus"
"github.com/Sirupsen/logrus/hooks/airbrake"
"github.com/Sirupsen/logrus/hooks/bugsnag"
)
func init() {
@@ -84,6 +85,11 @@ func init() {
// an exception tracker. You can create custom hooks, see the Hooks section.
log.AddHook(airbrake.NewHook("https://example.com", "xyz", "development"))
// Use the Bugsnag hook to report errors that have Error severity or above to
// an exception tracker. You can create custom hooks, see the Hooks section.
bugsnagHook, _ = logrus_bugsnag.NewBugsnagHook()
log.AddHook(bugsnagHook)
// Output to stderr instead of stdout, could also be a file.
log.SetOutput(os.Stderr)