From: Jonathan Amsterdam Date: Mon, 25 Sep 2023 12:41:31 +0000 (-0400) Subject: log/slog: clarify SetDefault behavior X-Git-Tag: go1.22rc2~8^2~1 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=759849187f51e40e36a507656485e34170f77497;p=gostls13.git log/slog: clarify SetDefault behavior Change-Id: I53250ca9e6d1ba69cc667949bebb5be2651a020d Reviewed-on: https://go-review.googlesource.com/c/go/+/530477 TryBot-Result: Gopher Robot Reviewed-by: Alan Donovan Run-TryBot: Jonathan Amsterdam --- diff --git a/src/log/slog/logger.go b/src/log/slog/logger.go index 4d21ee7990..10aa6a2b31 100644 --- a/src/log/slog/logger.go +++ b/src/log/slog/logger.go @@ -53,7 +53,8 @@ func init() { // Default returns the default [Logger]. func Default() *Logger { return defaultLogger.Load() } -// SetDefault makes l the default [Logger]. +// SetDefault makes l the default [Logger], which is used by +// the top-level functions [Info], [Debug] and so on. // After this call, output from the log package's default Logger // (as with [log.Print], etc.) will be logged using l's Handler, // at a level controlled by [SetLogLoggerLevel].