Documentation ¶
Overview ¶
Package sentry has a client with additional functionality and helpers to complement the official one.
Index ¶
- Constants
- func LogBreadcrumb(ctx context.Context, level sentry.Level, category, message string)
- func WithContext(ctx context.Context) context.Context
- type Client
- func (client *Client) Report(ctx context.Context, appErr error)
- func (client *Client) ReportPanic(ctx context.Context, panicErr interface{})
- func (client *Client) ReportPanics(ctx context.Context)
- func (client *Client) ReportPanicsRequest(r *http.Request)
- func (client *Client) ReportRequest(r *http.Request, appErr error)
- type Sentry
Constants ¶
const ( LevelFatal = sentry.LevelFatal LevelWarning = sentry.LevelWarning LevelError = sentry.LevelError LevelInfo = sentry.LevelInfo LevelDebug = sentry.LevelDebug )
Variables ¶
This section is empty.
Functions ¶
func LogBreadcrumb ¶
LogBreadcrumb logs a new breadcrumb in the Sentry instance of the context.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps a Sentry connection.
func NewClient ¶
NewClient opens a new connection to the Sentry report API. If dsn is empty it will return nil. A nil client can be used safely but it won't report anything.
func (*Client) ReportPanic ¶ added in v0.4.0
ReportPanic sends a panic correctly formated to the server if the argument is not nil.
func (*Client) ReportPanics ¶ added in v0.4.0
ReportPanics detects panics in the rest of the body of the function and reports it if one occurs.
func (*Client) ReportPanicsRequest ¶ added in v0.4.0
ReportPanicsRequest detects pancis in the body of the function and reports them linked to a HTTP request.
type Sentry ¶
type Sentry struct {
// contains filtered or unexported fields
}
Sentry accumulates info through out the whole request to send them in case an error is reported.
func FromContext ¶
FromContext returns the Sentry instance stored in the context. If no instance was created it will return nil.