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 Tag(ctx context.Context, key string, value string)
- func WithContext(ctx context.Context) context.Context
- func WithRequest(r *http.Request) *http.Request
- type Client
- func (client *Client) Flush(timeout time.Duration)
- 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)deprecated
- func (client *Client) ReportRequest(r *http.Request, appErr error)deprecated
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.
func WithContext ¶
WithContext stores a new instance of Sentry in the context and returns the new generated context that you should use everywhere.
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) Flush ¶ added in v0.6.2
Flush waits until the underlying Transport sends any buffered events.
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.