Documentation
¶
Overview ¶
Package sentry is a helper package for sentry integration
Index ¶
- Variables
- func NewLogger() *zap.SugaredLogger
- type Config
- type SentryZapCore
- func (s *SentryZapCore) Check(entry zapcore.Entry, checkedEntry *zapcore.CheckedEntry) *zapcore.CheckedEntry
- func (s *SentryZapCore) Enabled(level zapcore.Level) bool
- func (s *SentryZapCore) Sync() error
- func (s *SentryZapCore) With(fields []zapcore.Field) zapcore.Core
- func (s *SentryZapCore) Write(entry zapcore.Entry, fields []zapcore.Field) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidConfiguration = errors.New("invalid configuration")
ErrInvalidConfiguration is returned when the configuration is invalid
Functions ¶
func NewLogger ¶
func NewLogger() *zap.SugaredLogger
NewLogger creates a new zap logger with the appropriate configuration based on the viper settings for pretty and debug
Types ¶
type Config ¶
type Config struct {
Enabled bool `split_words:"true" default:"false"`
DSN string `split_words:"true"`
ServerName string `split_words:"true"`
Environment string `split_words:"true"`
EnableTracing bool `split_words:"true" default:"false"`
TracesSampler float64 `split_words:"true" default:"1.0"`
AttachStacktrace bool `split_words:"true" default:"true"`
SampleRate float64 `split_words:"true" default:"0.2"`
TracesSampleRate float64 `split_words:"true" default:"0.2"`
ProfilesSampleRate float64 `split_words:"true" default:"0.2"`
Repanic bool `ignored:"true"`
Debug bool `default:"false"`
}
Config for the Sentry client
func (Config) ClientOptions ¶
func (c Config) ClientOptions() sentry.ClientOptions
ClientOptions returns the sentry.ClientOptions for the configuration
func (Config) UsePerformanceTracking ¶
UsePerformanceTracking tracking is enabled if Sentry is enabled and track performance is explicitly set
type SentryZapCore ¶
type SentryZapCore struct {
// contains filtered or unexported fields
}
SentryZapCore is a zap core that sends logs to sentry
func (*SentryZapCore) Check ¶
func (s *SentryZapCore) Check(entry zapcore.Entry, checkedEntry *zapcore.CheckedEntry) *zapcore.CheckedEntry
Check returns a checked entry if the log level is enabled for the core
func (*SentryZapCore) Enabled ¶
func (s *SentryZapCore) Enabled(level zapcore.Level) bool
Enabled returns true if the log level is enabled
Click to show internal directories.
Click to hide internal directories.