Skip to content

Commit

Permalink
log/slog: clarify Logger.WithGroup doc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jba authored and eric committed Sep 7, 2023
1 parent 6e1306c commit ed25a8e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/log/slog/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ed25a8e

Please sign in to comment.