Skip to content

Commit 49021f2

Browse files
committed
Some fixes
Code style.
1 parent 320f1b3 commit 49021f2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

handler.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ func NewSentryHandler(
3232
}
3333

3434
// Enabled reports whether the handler handles records at the given level.
35-
func (s SentryHandler) Enabled(ctx context.Context, level slog.Level) bool {
35+
func (s *SentryHandler) Enabled(ctx context.Context, level slog.Level) bool {
3636
return s.Handler.Enabled(ctx, level)
3737
}
3838

3939
// Handle intercepts and processes logger messages.
4040
// In our case, send a message to the Sentry.
41-
func (s SentryHandler) Handle(ctx context.Context, record slog.Record) error {
41+
func (s *SentryHandler) Handle(ctx context.Context, record slog.Record) error {
4242
const (
4343
shortErrKey = "err"
4444
longErrKey = "error"
@@ -53,6 +53,7 @@ func (s SentryHandler) Handle(ctx context.Context, record slog.Record) error {
5353
sentry.CaptureException(err)
5454
}
5555
}
56+
5657
return true
5758
})
5859
case slog.LevelDebug, slog.LevelInfo, slog.LevelWarn:
@@ -64,11 +65,11 @@ func (s SentryHandler) Handle(ctx context.Context, record slog.Record) error {
6465
}
6566

6667
// WithAttrs returns a new SentryHandler whose attributes consists.
67-
func (s SentryHandler) WithAttrs(attrs []slog.Attr) slog.Handler {
68+
func (s *SentryHandler) WithAttrs(attrs []slog.Attr) slog.Handler {
6869
return NewSentryHandler(s.Handler.WithAttrs(attrs), s.levels)
6970
}
7071

7172
// WithGroup returns a new SentryHandler whose group consists.
72-
func (s SentryHandler) WithGroup(name string) slog.Handler {
73+
func (s *SentryHandler) WithGroup(name string) slog.Handler {
7374
return NewSentryHandler(s.Handler.WithGroup(name), s.levels)
7475
}

0 commit comments

Comments
 (0)