Skip to content

Commit

Permalink
Added things
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-holt-dochq committed Jan 24, 2021
1 parent d0add3f commit bca286e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sentry/sentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ var levelToSentryLevel = map[uint32]sentry.Level{
// Passthrough type for https://pkg.go.dev/github.com/getsentry/sentry-go#ClientOptions
type ConfigOptions struct {
sentry.ClientOptions
IgnoreLevelBelow uint32
}

// This is not a usual init as the user may need to change options before hand
Expand All @@ -36,7 +35,9 @@ func Flush(t time.Duration) {
sentry.Flush(t)
}

type Logger struct{}
type Logger struct {
IgnoreLevelBelow uint32
}

func (t Logger) Log(i interface{}, fields map[string]interface{}, level uint32, verbose bool) {
localHub := sentry.CurrentHub().Clone()
Expand All @@ -51,7 +52,7 @@ func (t Logger) Log(i interface{}, fields map[string]interface{}, level uint32,
scope.SetLevel(levelToSentryLevel[level])
})

if level == 0 {
if level <= t.IgnoreLevelBelow {
return // Don't log debug messages
}

Expand Down

0 comments on commit bca286e

Please sign in to comment.