Commit Graph
1 Commits
Author SHA1 Message Date
sneak 5d4b078304 Add a failing test pinning the discarded slog attributes
Every handler drops slog attributes: Handle never reads the record's
attributes, and WithAttrs and WithGroup return the receiver unchanged. So
slog.Info("casting", "device", d) loses its field.

The test checks the bytes each handler writes, directly and through
MultiplexHandler: record attributes, WithAttrs, WithGroup, slog.Group nesting
and LogValuer resolution. It also pins what a fix must not break: logged values
are never modified, durations are nanoseconds in JSON and "3s" on the console,
console keys are quoted like values, and the record's own field names win a key
collision.

This commit adds only the test, and it fails; the fix follows.

Rule suppressed: paralleltest, because the tests swap the process-wide
os.Stdout.

Refs: #19

Model: opus-5-5 (rebase, this message)
2026-09-28 10:34:46 +00:00