fix: nil-safe Logger level methods, doc accuracy, runnable examples#17
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cuts golog v1.1.1 (VERSION already set): a bug-fix and docs release surfaced by a
/devex-reviewaudit. Makes a nil*golog.Loggernil-safe across all level methods (Trace/Debug/Info/Warn/Error/Fataland theirAt/Ctx/f/fCtxvariants) so they return a nil*Messageinstead of panicking, honoring the contract indoc.go, withTestLogger_NilSafeLevelMethodscovering every variant. Adds runnableExamplefunctions for the primaryLoggerAPI and thelogsubpackage (shown on pkg.go.dev, verified bygo test) plus alogpackage doc comment, scopes the README duplicate-key-prevention claim to inherited attributes (same-chain duplicates are not deduplicated), and fixes thedoc.gocontext example to usegolog.NewString. Also bumpslogsentry's indirectgolang.org/x/textto v0.37.0 (aligns with thetoolsmodule) and ignores the.gstack/audit artifact. The[1.1.1] - 2026-06-17CHANGELOG section is cut from[Unreleased], and the full workspace passes build,go vet, gosec, and tests.