From: Sean Liao Date: Mon, 17 Mar 2025 18:18:48 +0000 (+0000) Subject: log/slog: document Logger ignores Handler.Handle errors X-Git-Tag: go1.25rc1~683 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c7ea87132f4e6f3c81e525c396a64471c9af0091;p=gostls13.git log/slog: document Logger ignores Handler.Handle errors Fixes #66579 Change-Id: Ie75378b087763c3e88303df3b3f8d7565003a92f Reviewed-on: https://go-review.googlesource.com/c/go/+/658515 Reviewed-by: Jonathan Amsterdam LUCI-TryBot-Result: Go LUCI Reviewed-by: Cherry Mui --- diff --git a/src/log/slog/handler.go b/src/log/slog/handler.go index 39b987b812..0451ea8fdc 100644 --- a/src/log/slog/handler.go +++ b/src/log/slog/handler.go @@ -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