Open evalphobia opened 7 years ago
There are many New... method to create *SentryHook. To scale configuration, add a config struct and use it in New() function.
New...
*SentryHook
New()
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... }
There are many
New...
method to create*SentryHook
. To scale configuration, add a config struct and use it inNew()
function.For example below,