From 044ca4e5c878c785e2c69e5ebcb3d44bf97abc9f Mon Sep 17 00:00:00 2001 From: Ernesto Alejandro Santana Hidalgo Date: Sun, 4 May 2025 04:30:25 +0000 Subject: log/slog: export Source method in Record for custom handler support Currently, the `source` method in `slog.Record` is not accessible to custom handlers, requiring developers to re-implement logic for retrieving source location information. This commit exports the `source` method as `Source`, enabling consistent access for custom logging handlers and reducing code redundancy. Fixes #70280 Change-Id: I3eb3bc60658abc5de95697a10bddd11ab54c6e13 GitHub-Last-Rev: bd81afe5a502bf0e2d03c30d0f5199a532cc4c62 GitHub-Pull-Request: golang/go#70281 Reviewed-on: https://go-review.googlesource.com/c/go/+/626976 Reviewed-by: qiu laidongfeng2 <2645477756@qq.com> Reviewed-by: Jonathan Amsterdam Reviewed-by: Cherry Mui LUCI-TryBot-Result: Go LUCI --- api/next/70280.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 api/next/70280.txt (limited to 'api') diff --git a/api/next/70280.txt b/api/next/70280.txt new file mode 100644 index 0000000000..f2dd74af48 --- /dev/null +++ b/api/next/70280.txt @@ -0,0 +1 @@ +pkg log/slog, method (Record) Source() *Source #70280 -- cgit v1.3