golang/src/log/slog
Jonathan Amsterdam db7bb2742c log/slog: handle times with undefined UnixNanos
slog tries to represent a time.Time without allocations, which involves
storing its UnixNanos value. But UnixNanos is undefined for some valid
times. Provide a fallback representation for those times by storing them
in the `any` field of `Value`.

Fixes #65902.

Change-Id: I736c739a92f77d7b1122ea0831524acdd2c4703f
Reviewed-on: https://go-review.googlesource.com/c/go/+/585519
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2024-05-16 16:12:08 +00:00
..
internal all: add missing copyright header 2023-11-17 23:34:11 +00:00
attr.go log/slog: use plain string concatenation for Attr.String 2024-03-25 18:23:25 +00:00
attr_test.go log/slog: use plain string concatenation for Attr.String 2024-03-25 18:23:25 +00:00
doc.go log/slog: document atomicity guarantees and ordering limitations of handlers 2024-02-15 14:35:48 +00:00
example_custom_levels_test.go log/slog: replace nil contexts with context.Background() 2023-07-11 17:06:26 +00:00
example_level_handler_test.go log/slog: built-in handler constructors take options as a second arg 2023-05-04 18:32:54 +00:00
example_log_level_test.go log/slog: add LogLoggerLevel to enable setting level on the default logger 2023-11-10 21:25:30 +00:00
example_logvaluer_group_test.go log/slog: initial commit 2023-03-21 20:55:33 +00:00
example_logvaluer_secret_test.go log/slog: built-in handler constructors take options as a second arg 2023-05-04 18:32:54 +00:00
example_test.go slog: factoring out code to make the examples playable 2023-11-17 14:56:30 +00:00
example_wrap_test.go log/slog: built-in handler constructors take options as a second arg 2023-05-04 18:32:54 +00:00
handler.go log/slog: correct doc examples for Handler.WithGroup 2023-12-05 18:18:13 +00:00
handler_test.go log/slog: JSONHandler elides empty groups even with replacement 2023-10-02 13:57:53 +00:00
json_handler.go log/slog: make hex a const 2023-11-17 16:18:11 +00:00
json_handler_test.go log/slog: replace nil contexts with context.Background() 2023-07-11 17:06:26 +00:00
level.go log/slog: Reorder doc comment for level constants 2023-10-30 17:34:43 +00:00
level_test.go log/slog: correct formatting 2024-02-20 20:44:14 +00:00
logger.go log/slog: clarify SetDefault behavior 2024-01-08 18:26:18 +00:00
logger_test.go log/slog: add LogLoggerLevel to enable setting level on the default logger 2023-11-10 21:25:30 +00:00
record.go log/slog: fix method name in docs 2023-11-08 16:30:56 +00:00
record_test.go log/slog: don't panic on aliased Record 2023-08-07 15:10:55 +00:00
slogtest_test.go log/slog: test built-in handlers with slogtest 2023-05-10 12:50:22 +00:00
text_handler.go log: add available godoc link 2023-10-23 22:56:07 +00:00
text_handler_test.go log/slog: increase test coverage 2023-05-22 19:05:59 +00:00
value.go log/slog: handle times with undefined UnixNanos 2024-05-16 16:12:08 +00:00
value_access_benchmark_test.go log/slog: initial commit 2023-03-21 20:55:33 +00:00
value_test.go log/slog: handle times with undefined UnixNanos 2024-05-16 16:12:08 +00:00