Documentation ¶
Index ¶
- Constants
- Variables
- func NewAsyncHandler(h slog.Handler) slog.Handler
- func NewJSONHandler(opts ...Option) slog.Handler
- func NewTextHandler(opts ...Option) slog.Handler
- func ToInterface[T any](values []T) []any
- func WithErr(err error) slog.Attr
- func WithStack(err error) slog.Attr
- type AsyncHandler
- type Backend
- type BackendLoggingHandle
- type ErrorTracking
- type Handle
- type LoggingHandle
- type Option
- type ReplaceAttr
- type RollbarConfig
- type SentryConfig
- type Service
Constants ¶
View Source
const ( JsonHandler = LoggingHandle("json") TextHandler = LoggingHandle("text") SentryHandler = LoggingHandle("sentry") RollbarHandler = LoggingHandle("rollbar") )
View Source
const ( BackendJsonHandler = BackendLoggingHandle("json") BackendTextHandler = BackendLoggingHandle("text") )
Variables ¶
Functions ¶
func NewJSONHandler ¶
func NewTextHandler ¶
func ToInterface ¶
Types ¶
type AsyncHandler ¶
func (*AsyncHandler) Close ¶
func (h *AsyncHandler) Close() error
type Backend ¶
type Backend struct { Level slog.Level `yaml:"level" default:"info"` Handler BackendLoggingHandle `yaml:"handler" default:"json"` }
type BackendLoggingHandle ¶
type BackendLoggingHandle string
type ErrorTracking ¶
func (*ErrorTracking) Close ¶
func (h *ErrorTracking) Close() error
type Handle ¶
func NewErrorTracking ¶
func NewHandler ¶
func NewRollbarHandler ¶
func NewRollbarHandler(conf *RollbarConfig) Handle
func NewSentryHandler ¶
func NewSentryHandler(conf *SentryConfig, environment string) Handle
type LoggingHandle ¶
type LoggingHandle string
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithHandler ¶
func WithReplaceAttr ¶
func WithReplaceAttr(attrFn ReplaceAttr) Option
func WithWriter ¶
type RollbarConfig ¶
type RollbarConfig struct { LogLevel string `yaml:"logLevel" default:"warn"` Token string `yaml:"token"` Backend Backend `yaml:"backend"` Client *http.Client // contains filtered or unexported fields }
func (*RollbarConfig) Close ¶
func (c *RollbarConfig) Close()
func (*RollbarConfig) Init ¶
func (c *RollbarConfig) Init(env, version, serverRoot string)
type SentryConfig ¶
type SentryConfig struct { LogLevel string `yaml:"logLevel" default:"warn"` DSN string `yaml:"dsn"` SampleRate float64 `yaml:"sampleRate" default:"1.0"` IgnoreErrors []string `yaml:"ignoreErrors"` Debug bool `yaml:"debug"` SendDefaultPII bool `yaml:"sendDefaultPII"` Backend Backend `yaml:"backend"` Environment string Transport sentry.Transport }
func (*SentryConfig) SentryOptions ¶
func (c *SentryConfig) SentryOptions(environment string) sentry.ClientOptions
Click to show internal directories.
Click to hide internal directories.