Skip to content

Commit ed25a8e

Browse files
jbaeric
authored andcommitted
log/slog: clarify Logger.WithGroup doc
Make it clear that "qualified by the given name" doesn't imply any particular implementation, but depends on how the Handler treats groups. Updates golang#56345. Change-Id: Idf52553108bc1a7d2091a06cc4fc4cc0fc52cc14 Reviewed-on: https://go-review.googlesource.com/c/go/+/478056 Reviewed-by: Alan Donovan <adonovan@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Jonathan Amsterdam <jba@google.com>
1 parent 6e1306c commit ed25a8e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/log/slog/logger.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ func (l *Logger) With(args ...any) *Logger {
109109

110110
// WithGroup returns a new Logger that starts a group. The keys of all
111111
// attributes added to the Logger will be qualified by the given name.
112+
// (How that qualification happens depends on the [Handler.WithGroup]
113+
// method of the Logger's Handler.)
112114
// The new Logger shares the old Logger's context.
113115
//
114116
// The new Logger's handler is the result of calling WithGroup on the receiver's

0 commit comments

Comments
 (0)