Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorKeys = []string{"error", "err"}
View Source
var LogLevels = map[slog.Level]string{ slog.LevelDebug: rollbar.DEBUG, slog.LevelInfo: rollbar.INFO, slog.LevelWarn: rollbar.WARN, slog.LevelError: rollbar.ERR, }
View Source
var SourceKey = "source"
Functions ¶
Types ¶
type Option ¶
type Option struct {
// log level (default: debug)
Level slog.Leveler
// Rollbar client
Client *rollbar.Client
Timeout time.Duration // default: 10s
SkipFrames *int // default: 2
// optional: customize Rollbar event builder
Converter Converter
// optional: fetch attributes from context
AttrFromContext []func(ctx context.Context) []slog.Attr
// optional: see slog.HandlerOptions
AddSource bool
ReplaceAttr func(groups []string, a slog.Attr) slog.Attr // default: removeRequestAttr
}
func (Option) NewRollbarHandler ¶
Click to show internal directories.
Click to hide internal directories.