You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Richard Lewis 34c4874acd Name wikipedia query struct, message formatting, fix tests 8 years ago
..
LICENSE An extensible Matrix bot written in Go 9 years ago
README.md An extensible Matrix bot written in Go 9 years ago
bench_test.go An extensible Matrix bot written in Go 9 years ago
circle.yml An extensible Matrix bot written in Go 9 years ago
gobrake.go An extensible Matrix bot written in Go 9 years ago
notice.go An extensible Matrix bot written in Go 9 years ago
notifier.go An extensible Matrix bot written in Go 9 years ago
notifier_test.go An extensible Matrix bot written in Go 9 years ago
util.go An extensible Matrix bot written in Go 9 years ago

README.md

Airbrake Golang Notifier Build Status

Example

package main

import (
	"errors"

	"gopkg.in/airbrake/gobrake.v2"
)

var airbrake = gobrake.NewNotifier(1234567, "FIXME")

func init() {
	airbrake.AddFilter(func(notice *gobrake.Notice) *gobrake.Notice {
		notice.Context["environment"] = "production"
		return notice
	})
}

func main() {
	defer airbrake.WaitAndClose(5*time.Second)
	defer airbrake.NotifyOnPanic()

	airbrake.Notify(errors.New("operation failed"), nil)
}

Ignoring notices

airbrake.AddFilter(func(notice *gobrake.Notice) *gobrake.Notice {
	if notice.Context["environment"] == "development" {
		// Ignore notices in development environment.
		return nil
	}
	return notice
})

Logging

You can use glog fork to send your logs to Airbrake.