]> Cypherpunks repositories - gostls13.git/commitdiff
log/slog: document Logger ignores Handler.Handle errors
authorSean Liao <sean@liao.dev>
Mon, 17 Mar 2025 18:18:48 +0000 (18:18 +0000)
committerJonathan Amsterdam <jba@google.com>
Mon, 17 Mar 2025 20:39:09 +0000 (13:39 -0700)
Fixes #66579

Change-Id: Ie75378b087763c3e88303df3b3f8d7565003a92f
Reviewed-on: https://go-review.googlesource.com/c/go/+/658515
Reviewed-by: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/log/slog/handler.go

index 39b987b812ed4bff651b6325ba4fa557bbacc82a..0451ea8fdcc126b30ad391fb71ab36ff72a10d41 100644 (file)
@@ -57,6 +57,9 @@ type Handler interface {
        //   - If a group's key is empty, inline the group's Attrs.
        //   - If a group has no Attrs (even if it has a non-empty key),
        //     ignore it.
+       //
+       // [Logger] discards any errors from Handle. Wrap the Handle method to
+       // process any errors from Handlers.
        Handle(context.Context, Record) error
 
        // WithAttrs returns a new Handler whose attributes consist of