Repository navigation
·
0 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
What's Changed
⚠️ Module path moved
The module is now github.com/angryboat/slog-lambda. Update your imports:
-import sloglambda "github.com/maddiesch/slog-lambda"
+import sloglambda "github.com/angryboat/slog-lambda"Features
WithFunctionName()andWithFunctionVersion()options override the function name and version that are otherwise read from the Lambda environment- Function name and version are now read from the environment once in
NewHandlerinstead of on every log call
Performance
- Records are appended directly to a pooled byte buffer, mirroring
slog.JSONHandler, instead of building an intermediate map - The
WithAttrs/WithGroupchain is pre-serialized once, soHandlecopies bytes instead of re-walking the chain per record - JSON output now uses stdlib field order:
time,level,source,msg,type,record, then attrs in call order
Bug Fixes
- A value that fails to JSON-encode no longer drops the whole log record; it's written as an
!ERROR:<msg>string in place json.Marshaleroutput is embedded verbatim (compacted) instead of double-encoded, and quoted in text format when needed- User attrs named
recordortypeno longer clobber the handler's keys; they're renamed torecord_/type_without overwriting an existing fallback key - A nil
fmt.Stringerno longer panics in text mode WithLevel(nil)is treated as INFO instead of panicking on the first log call- Text keys and non-string values are quoted when needed, including the DEL byte
- Nested empty groups are omitted, per
slogtest - Unnamed
LogValuers are resolved once, and empty groups are ignored when scanning for reserved-key collisions - Oversized prefix buffers are kept out of the state pool
Documentation
- Documented Lambda key conventions, level suffixes, and reserved-key rename edge cases
- Refreshed README and CLAUDE.md
CI
- Test matrix covers Go 1.25, 1.26, 1.27, and stable on Linux x64 and arm64
- GitHub Actions bumped to current majors, with Dependabot keeping them updated
- Release workflow validates the version input and pins gosec
- Bumped testify to v1.12.1
Full Changelog: v1.2.1...v1.3.0