]> Cypherpunks repositories - gostls13.git/commitdiff
log/slog: clarify Logger.WithGroup doc
authorJonathan Amsterdam <jba@google.com>
Tue, 21 Mar 2023 12:57:43 +0000 (08:57 -0400)
committerJonathan Amsterdam <jba@google.com>
Tue, 21 Mar 2023 20:55:59 +0000 (20:55 +0000)
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/go#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>

src/log/slog/logger.go

index fc734b2ba6bc58e877de06043838dbcf65c41222..f58add9af95b88f6db7aa2d055953c656ce2d42f 100644 (file)
@@ -109,6 +109,8 @@ func (l *Logger) With(args ...any) *Logger {
 
 // WithGroup returns a new Logger that starts a group. The keys of all
 // attributes added to the Logger will be qualified by the given name.
+// (How that qualification happens depends on the [Handler.WithGroup]
+// method of the Logger's Handler.)
 // The new Logger shares the old Logger's context.
 //
 // The new Logger's handler is the result of calling WithGroup on the receiver's