Repository navigation
feat(logger): adopt the rewritten logger with automatic format selection - #74
Merged
Merged
Conversation
The logger rewrite replaced every zap call site with the new forge logger, so zap and its multierr dependency were just dead weight in go.mod. go mod tidy confirms it: build and the full test suite still pass with them gone.
forge is 38 Go modules, not one. The root go.mod replace for github.com/xraph/go-utils doesn't reach sibling modules, so each one that compiles forge/internal/logger was resolving go-utils from the proxy at v1.2.2, which predates the logger rewrite and lacks log.Config, log.New, log.Format and the rest of the new API. The gitignored go.work covering . and ./cmd/forge hid this from every check run so far. Add a temporary replace to each affected module, computed per module depth rather than hardcoded, and comment it as removable once go-utils is tagged. cmd/forge is deliberately excluded: its go.mod carries an explicit "no replace directives" policy for `go install` compatibility, and its build failure (cfg.StripPrefixes undefined) is unrelated to go-utils, pre-existing, and reproduces at base commit 8dd10aa with no go-utils changes involved. None of the 27 needed a go.sum update.
The logger rewrite is released, so the temporary replace directives that pointed every module at ../go-utils come out. All 28 are gone and each module now resolves the published v1.3.0. Five example modules needed a further fix. They resolved github.com/xraph/forge from the proxy rather than this tree, so they compiled a published forge whose internal/logger still references log.FormatConfig and log.DefaultFormatConfig, both removed in v1.3.0: forge@v1.9.13/internal/logger/exports.go:8:25: undefined: log.FormatConfig They now replace forge with the local tree, which is what every example module that already built was doing. Worth knowing that this is the general shape of the problem: any module pairing a pre-v1.3.0 forge with go-utils v1.3.0 will fail the same way, and the version numbers give no warning because the break shipped as a minor. 37 of 38 modules build with GOWORK=off against the published module. cmd/forge is the exception and fails on cfg.StripPrefixes, which it also does at the base commit, unrelated to this work.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Conventional Commits ValidationPR Title: valid |
This was referenced Sep 6, 2026
This branch was successfully deployed
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.
Moves forge onto
go-utilsv1.3.0, whose logger was rewritten. Companion toxraph/go-utils#6.
What changes for a forge app
Log output now picks its own format. A terminal gets aligned, coloured columns;
anything else gets JSON.
FORGE_LOG_FORMAToverrides both. Undergo testitresolves to a noop so suites stay quiet, and
go test -vbrings it back.That is why this is titled
featrather thanfix: every app's log outputchanges shape. On release-please's
bump-minor-pre-major, afeattakes0.8.0 to 0.9.0. If you would rather ship it as 0.8.1, retitle this to
fix(logger):before merging, since the title is what release-please reads.Also fixed:
AppConfig.Environmentvalues other thandevelopmentandproductionused to get a noop logger, soENVIRONMENT=stagingsilentlydiscarded every line. Unknown environments now get a real logger.
What is in the diff
internal/loggerdrops the zap-coupled re-exports (ZapField,Object,Array,WrapZapField(s),FieldsToZap,ValidateField,SanitizeFields,FieldMap,MergeFields,FormatConfig,NewDevelopmentLoggerWithLevel).All had zero call sites in forge and none was re-exported from the public
forge/logger.go.app_impl.goloses the three-arm environment switch.go.modfiles pingo-utilsv1.3.0. The temporary localreplacedirectives are gone.
github.com/xraph/forgewith this tree.They were resolving a published forge whose
internal/loggerreferenceslog.FormatConfig, removed in v1.3.0.forge/logger.gois untouched,LoggerandSugarLoggerare unchanged, andnone of the ~1,443 logger call sites across 218 files needed an edit.
Verification
37 of 38 modules build with
GOWORK=offagainst the published v1.3.0. Theexception is
cmd/forge, which fails oncfg.StripPrefixesat the base committoo and is unrelated to this work. Root suite passes under
-race.