Documentation ¶
Index ¶
- Constants
- Variables
- func Error(level string, err error)
- func ErrorWithExtras(level string, err error, extras map[string]interface{})
- func ErrorWithStackSkip(level string, err error, skip int)
- func ErrorWithStackSkipWithExtras(level string, err error, skip int, extras map[string]interface{})
- func Message(level string, msg string)
- func MessageWithExtras(level string, msg string, extras map[string]interface{})
- func RequestError(level string, r *http.Request, err error)
- func RequestErrorWithExtras(level string, r *http.Request, err error, extras map[string]interface{})
- func RequestErrorWithStackSkip(level string, r *http.Request, err error, skip int)
- func RequestErrorWithStackSkipWithExtras(level string, r *http.Request, err error, skip int, ...)
- func Wait()
- type CauseStacker
- type Frame
- type Stack
Constants ¶
const ( NAME = "heroku/rollbar" VERSION = "0.3.0" // 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" // 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 HTTP Headers parameters from being sent to Rollbar. FilterHeaders = regexp.MustCompile("Authorization") // Filter GET and POST parameters from being sent to Rollbar. FilterFields = regexp.MustCompile("password|secret|token") // String describing the running code version on the server CodeVersion = "" // host: The server hostname. Will be indexed. ServerHost, _ = os.Hostname() // root: Path to the application code root, not including the final slash. // Used to collapse non-project code when displaying tracebacks. ServerRoot = "" )
Functions ¶
func ErrorWithExtras ¶
Error asynchronously sends an error to Rollbar with the given severity level with extra custom data.
func ErrorWithStackSkip ¶
ErrorWithStackSkip asynchronously sends an error to Rollbar with the given severity level and a given number of stack trace frames skipped.
func ErrorWithStackSkipWithExtras ¶
ErrorWithStackSkip asynchronously sends an error to Rollbar with the given severity level and a given number of stack trace frames skipped with extra custom data.
func Message ¶
Message asynchronously sends a message to Rollbar with the given severity level. Rollbar request is asynchronous.
func MessageWithExtras ¶
Message asynchronously sends a message to Rollbar with the given severity level with extra custom data. Rollbar request is asynchronous.
func RequestError ¶
RequestError asynchronously sends an error to Rollbar with the given severity level and request-specific information.
func RequestErrorWithExtras ¶
func RequestErrorWithExtras(level string, r *http.Request, err error, extras map[string]interface{})
RequestError asynchronously sends an error to Rollbar with the given severity level and request-specific information with extra custom data.
func RequestErrorWithStackSkip ¶
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.
func RequestErrorWithStackSkipWithExtras ¶
func RequestErrorWithStackSkipWithExtras(level string, r *http.Request, err error, skip int, extras map[string]interface{})
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 and extra custom data.
Types ¶
type CauseStacker ¶
Errors can implement this interface to create a trace_chain Callers are required to call BuildStack on their own at the time the cause is wrapped.
type Stack ¶
type Stack []Frame
func BuildStack ¶
func (Stack) Fingerprint ¶
Create a fingerprint that uniqely 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.