Skip to content

Commit 744f3b9

Browse files
committedJul 10, 2024··
feat: when the name is empty, WithGroup returns the receiver
1 parent de18993 commit 744f3b9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎handler.go

+5
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ func (h *ZapHandler) WithAttrs(attrs []slog.Attr) slog.Handler {
9999
}
100100

101101
func (h *ZapHandler) WithGroup(name string) slog.Handler {
102+
// https://cs.opensource.google/go/x/exp/+/46b07846:slog/handler.go;l=247
103+
if name == "" {
104+
return h
105+
}
106+
102107
return &ZapHandler{
103108
option: h.option,
104109
attrs: h.attrs,

0 commit comments

Comments
 (0)
Please sign in to comment.