Skip to content

fix: nil-safe Logger level methods, doc accuracy, runnable examples#17

Merged
ungerik merged 1 commit into
masterfrom
ungerik/medan
Jun 17, 2026
Merged

fix: nil-safe Logger level methods, doc accuracy, runnable examples#17
ungerik merged 1 commit into
masterfrom
ungerik/medan

Conversation

@ungerik

@ungerik ungerik commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Cuts golog v1.1.1 (VERSION already set): a bug-fix and docs release surfaced by a /devex-review audit. Makes a nil *golog.Logger nil-safe across all level methods (Trace/Debug/Info/Warn/Error/Fatal and their At/Ctx/f/fCtx variants) so they return a nil *Message instead of panicking, honoring the contract in doc.go, with TestLogger_NilSafeLevelMethods covering every variant. Adds runnable Example functions for the primary Logger API and the log subpackage (shown on pkg.go.dev, verified by go test) plus a log package doc comment, scopes the README duplicate-key-prevention claim to inherited attributes (same-chain duplicates are not deduplicated), and fixes the doc.go context example to use golog.NewString. Also bumps logsentry's indirect golang.org/x/text to v0.37.0 (aligns with the tools module) and ignores the .gstack/ audit artifact. The [1.1.1] - 2026-06-17 CHANGELOG section is cut from [Unreleased], and the full workspace passes build, go vet, gosec, and tests.

…ples

Fixed:
- Guard all Logger level methods (Trace/Debug/Info/Warn/Error/Fatal and their
  At/Ctx/f/fCtx variants) against a nil receiver, returning a nil *Message
  instead of panicking, honoring the nil-safe contract documented in doc.go.
  Adds TestLogger_NilSafeLevelMethods.

Added:
- Runnable Example functions for the primary Logger API and the log subpackage
  (visible on pkg.go.dev, verified by go test); package doc comment for log.

Changed:
- logsentry: bump indirect golang.org/x/text v0.34.0 -> v0.37.0 (aligns with
  the tools submodule).

Documentation:
- Scope duplicate-key-prevention docs to inherited attributes in README;
  same-chain duplicates are not deduplicated.
- Fix the doc.go context example to use golog.NewString (no golog.Str exists).

Release prep:
- Cut the [1.1.1] - 2026-06-17 CHANGELOG section from [Unreleased] (VERSION is
  already v1.1.1).
- Ignore the .gstack/ browse-audit artifact in .gitignore.
@ungerik ungerik merged commit ce234b4 into master Jun 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant