From 759849187f51e40e36a507656485e34170f77497 Mon Sep 17 00:00:00 2001 From: Jonathan Amsterdam Date: Mon, 25 Sep 2023 08:41:31 -0400 Subject: [PATCH] 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 --- src/log/slog/logger.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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]. -- 2.48.1