faultline-go

module
v0.1.1-0...-c08a0e3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2018 License: BSD-3-Clause, MIT

README

faultline-go Build Status GitHub release

faultline exception and error notifier for Go.

Requirement

Usage

package main

import (
	"errors"
	"github.com/faultline/faultline-go/faultline"
)

var notifications = []interface{}{
	faultline.Slack{
		Type:           "slack",
		Endpoint:       "https://hooks.slack.com/services/XXXXXXXXXX/BAC0D0N69/NacHbWgIfklAHH7XBEItGNcs",
		Channel:        "#random",
		Username:       "faultline-notify",
		NotifyInterval: 5,
		Threshold:      10,
		Timezone:       "Asia/Tokyo",
	},
}

var notifier = faultline.NewNotifier("faultline-go-project", "xxxxXXXXXxXxXXxxXXXXXXXxxxxXXXXXX", "https://xxxxxxxxx.execute-api.ap-northeast-1.amazonaws.com/v0", notifications)

func main() {
	defer notifier.Close()
	defer notifier.NotifyOnPanic()

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

References

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL