Documentation ¶
Index ¶
- Constants
- Variables
- func Error(level string, err error, fields ...*Field)
- func ErrorWithStack(level string, err error, stack Stack, fields ...*Field)
- func ErrorWithStackSkip(level string, err error, skip int, fields ...*Field)
- func Message(level string, msg string)
- func RequestError(level string, r *http.Request, err error, fields ...*Field)
- func RequestErrorWithStack(level string, r *http.Request, err error, stack Stack, fields ...*Field)
- func RequestErrorWithStackSkip(level string, r *http.Request, err error, skip int, fields ...*Field)
- func Wait()
- type Field
- type Frame
- type Stack
Constants ¶
const ( NAME = "go-rollbar" VERSION = "0.3.1" // Severity levels CRIT = "critical" ERR = "error" WARN = "warning" INFO = "info" DEBUG = "debug" FILTERED = "[FILTERED]" )
Variables ¶
var ( // Rollbar access token. If this is blank, no errors will be reported to // Rollbar. Token = "" // All errors and messages will be submitted under this environment. Environment = "development" // Platform, default to OS, but could be change ('client' for instance) Platform = runtime.GOOS // API endpoint for Rollbar. Endpoint = "https://api.rollbar.com/api/1/item/" // Maximum number of errors allowed in the sending queue before we start // dropping new errors on the floor. Buffer = 1000 // Filter GET and POST parameters from being sent to Rollbar. FilterFields = regexp.MustCompile("password|secret|token") // Output of error, by default stderr ErrorWriter = os.Stderr )
Functions ¶
func Error ¶
Error asynchronously sends an error to Rollbar with the given severity level. You can pass, optionally, custom Fields to be passed on to Rollbar.
func ErrorWithStack ¶
ErrorWithStack asynchronously sends and error to Rollbar with the given stacktrace and (optionally) custom Fields to be passed on to Rollbar.
func ErrorWithStackSkip ¶
ErrorWithStackSkip asynchronously sends an error to Rollbar with the given severity level and a given number of stack trace frames skipped. You can pass, optionally, custom Fields to be passed on to Rollbar.
func RequestError ¶
RequestError asynchronously sends an error to Rollbar with the given severity level and request-specific information. You can pass, optionally, custom Fields to be passed on to Rollbar.
func RequestErrorWithStack ¶
RequestErrorWithStack asynchronously sends an error to Rollbar with the given severity level, request-specific information provided by the given http.Request, and a custom Stack. You You can pass, optionally, custom Fields to be passed on to Rollbar.
func RequestErrorWithStackSkip ¶
func RequestErrorWithStackSkip(level string, r *http.Request, err error, skip int, fields ...*Field)
RequestErrorWithStackSkip asynchronously sends an error to Rollbar with the given severity level and a given number of stack trace frames skipped, in addition to extra request-specific information. You can pass, optionally, custom Fields to be passed on to Rollbar.
Types ¶
type Field ¶
type Field struct { Name string Data interface{} }
Fields can be used to pass arbitrary data to the Rollbar API.
type Stack ¶
type Stack []Frame
func BuildStack ¶
func (Stack) Fingerprint ¶
Create a fingerprint that uniquely identify a given message. We use the full callstack, including file names. That ensure that there are no false duplicates but also means that after changing the code (adding/removing lines), the fingerprints will change. It's a trade-off.