Documentation ¶
Overview ¶
Package airbrake provides Airbrake integration.
Create a new handler as you would create a gobrake.Notifier:
projectID := int64(1) projectKey := "key" handler := airbrake.NewHandler(projectID, projectKey)
If you need access to the underlying Notifier instance (or need more advanced construction), you can create the handler from a notifier directly:
projectID := int64(1) projectKey := "key" notifier := gobrake.NewNotifier(projectID, projectKey) handler := airbrake.NewHandlerFromNotifier(notifier)
By default Gobrake sends errors asynchronously and expects to be closed before the program finishes:
func main() { defer handler.Close() }
If you want to Flush notices you can do it as you would with Gobrake's notifier or you can configure the handler to send notices synchronously:
handler := airbrake.NewHandlerFromNotifier(notifier, airbrake.SendSynchronously(true))
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is responsible for sending errors to Airbrake/Errbit.
func NewHandler ¶
NewHandler creates a new Airbrake handler.
func NewHandlerFromNotifier ¶ added in v0.10.0
NewHandlerFromNotifier creates a new Airbrake handler from a notifier instance.
type Option ¶ added in v0.10.0
type Option interface {
// contains filtered or unexported methods
}
Option configures a logger instance.
type SendSynchronously ¶ added in v0.10.0
type SendSynchronously bool
SendSynchronously configures the handler to send notices synchronously.