Skip to content

Commit

Permalink
Return receiver in WithGroups method when name is empty (#5)
Browse files Browse the repository at this point in the history
* Return receiver in WithGroups method when name is empty

* Update handler.go

---------

Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
  • Loading branch information
katevi and samber authored Jul 10, 2024
1 parent d253dd8 commit cbd979a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ func (h *SyslogHandler) WithAttrs(attrs []slog.Attr) slog.Handler {
}

func (h *SyslogHandler) WithGroup(name string) slog.Handler {
// https://cs.opensource.google/go/x/exp/+/46b07846:slog/handler.go;l=247
if name == "" {
return h
}

return &SyslogHandler{
option: h.option,
attrs: h.attrs,
Expand Down

0 comments on commit cbd979a

Please sign in to comment.