Skip to content

Commit

Permalink
Merge pull request #10 from tomerf/fix_with_x
Browse files Browse the repository at this point in the history
Fixed WithX functions to preserve options
  • Loading branch information
remychantenay authored Feb 27, 2024
2 parents 43a976b + 087697b commit 5d304df
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions slog_otel.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,15 @@ func (h OtelHandler) Handle(ctx context.Context, record slog.Record) error {
func (h OtelHandler) WithAttrs(attrs []slog.Attr) slog.Handler {
return OtelHandler{
Next: h.Next.WithAttrs(attrs),
NoBaggage: h.NoBaggage,
}
}

// WithGroup returns a new Otel with a group, provided the group's name.
func (h OtelHandler) WithGroup(name string) slog.Handler {
return OtelHandler{
Next: h.Next.WithGroup(name),
NoBaggage: h.NoBaggage,
}
}

Expand Down

0 comments on commit 5d304df

Please sign in to comment.