MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / Wrap

Method Wrap

pkg/log/middleware/sentry/sentry.go:36–43  ·  view source on GitHub ↗

Wrap an existing log handler with Sentry.

(next log.Handler)

Source from the content-addressed store, hash-verified

34
35// Wrap an existing log handler with Sentry.
36func (s *Sentry) Wrap(next log.Handler) log.Handler {
37 return log.HandlerFunc(func(entry log.Entry) error {
38 if entry.Level() == log.ErrorLevel {
39 s.forward(entry)
40 }
41 return next.HandleLog(entry)
42 })
43}
44
45func (s *Sentry) forward(e log.Entry) *sentry.EventID {
46 fields := e.Fields().Fields()

Callers

nothing calls this directly

Calls 4

forwardMethod · 0.95
HandlerFuncFuncType · 0.92
LevelMethod · 0.65
HandleLogMethod · 0.65

Tested by

no test coverage detected