Skip to content

v0.1.21 – Add Go version compatibility fix for slog.Record source handling

Choose a tag to compare

@albeebe albeebe released this 15 Oct 14:32
· 6 commits to main since this release

Fixes

  • Replaced usage of slog.Record.Source() with a Go-version-safe runtime-based source lookup.
  • Restores compatibility with Go versions prior to 1.22, which do not expose the Source() method.

Context

Older Go versions had an unexported source() method on slog.Record.
This change ensures the logger builds and runs correctly across all supported Go toolchains.