go/src/log
Ernesto Alejandro Santana Hidalgo 044ca4e5c8 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: bd81afe5a5
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 <jba@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-05-06 03:58:07 -07:00
..
internal log,log/slog: get correct source line when slog calls log 2023-04-12 18:33:50 +00:00
slog log/slog: export Source method in Record for custom handler support 2025-05-06 03:58:07 -07:00
syslog all: use a more straightforward return value 2025-02-18 09:28:50 -08:00
example_test.go
log.go log/slog: use consistent call depth for all output 2025-03-11 13:50:02 -07:00
log_test.go log/slog: use consistent call depth for all output 2025-03-11 13:50:02 -07:00