Replace internal logger with uber-go/zap #1362
Draft
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.
Closes #383
Eliminates singleton logger pattern in favour of per-component zap instances. Replaces slog-based logging interface with direct zap calls throughout the codebase.
Design Approach
This PR follows the design proposal outlined in Issue #383.
Seeking feedback on design decisions: Please review the approach of passing logger instances through function parameters and constructor injection patterns used throughout the codebase.
The following files have been temporarily initialized with a package-level logger to simplify the initial design. Based on the feedback, these will updated in the final draft as well:
cmd/thv/
main.go
app/common.go
cmd/thv-proxy-runner/app/commands.go
cmd/regup/
main.go
app/root.go
Additionally,
pkg/audit
is still using slog internally but can be updated if required, once we confirm the rest of the design is good to go.Next Steps:
logger.go
andlogger_test.go
cmd/
dirs, if requiredpkg/audit
from slog to zap, if required