-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Description
There are many New... method to create *SentryHook.
To scale configuration, add a config struct and use it in New() function.
For example below,
// something like this
type Config struct {
Levels []logrus.Level
StacktraceConfiguration
DSN string
Async bool
Tags map[string]string
Release string
Environment string
// etc...
}
func New(conf Config) (*SentryHook, error) {
client, err := raven.NewWithTags(conf.DSN, conf.Tags)
if err != nil {
return nil, err
}
if conf.Release != "" {
client.SetRelease(conf.Release)
}
if conf.Environment != "" {
client.SetEnvironment(conf.Environment)
}
hook := &SentryHook{
asynchronous: conf.Async,
}
// etc...
}Metadata
Metadata
Assignees
Labels
No labels