]> Cypherpunks.ru repositories - gostls13.git/commitdiff
log/slog: clarify SetDefault behavior
authorJonathan Amsterdam <jba@google.com>
Mon, 25 Sep 2023 12:41:31 +0000 (08:41 -0400)
committerJonathan Amsterdam <jba@google.com>
Mon, 8 Jan 2024 18:26:18 +0000 (18:26 +0000)
Change-Id: I53250ca9e6d1ba69cc667949bebb5be2651a020d
Reviewed-on: https://go-review.googlesource.com/c/go/+/530477
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>

src/log/slog/logger.go

index 4d21ee7990f9f285d8335a36e6cd40c801007b82..10aa6a2b314feb49a1c5aaa0e28ae92fbe795ac2 100644 (file)
@@ -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].