Goal
Standardize on structured slog logging across the codebase. Today some call sites use slog.Error(fmt.Sprintf(...)), which loses structured fields and makes log processing harder.
Files (audit)
input/chainsync/*.go
output/*/*.go
filter/*/*.go
api/*.go
Changes
Replace slog.Error(fmt.Sprintf(...)) and similar patterns with structured field calls. Where a logger lacks a component context, attach one via slog.With("component", "<name>").
// before
slog.Error(fmt.Sprintf("failed to process %s: %v", item, err))
// after
slog.Error("failed to process item", "item", item, "error", err)
Apply the same pattern to slog.Warn and slog.Info call sites that interpolate via fmt.Sprintf.
Verification
go build ./...
golangci-lint run
grep -rEn 'slog\.[A-Za-z]+\(fmt\.Sprintf' --include='*.go'
The grep should produce no output.
Dependencies
None.
Goal
Standardize on structured
sloglogging across the codebase. Today some call sites useslog.Error(fmt.Sprintf(...)), which loses structured fields and makes log processing harder.Files (audit)
input/chainsync/*.gooutput/*/*.gofilter/*/*.goapi/*.goChanges
Replace
slog.Error(fmt.Sprintf(...))and similar patterns with structured field calls. Where a logger lacks a component context, attach one viaslog.With("component", "<name>").Apply the same pattern to
slog.Warnandslog.Infocall sites that interpolate viafmt.Sprintf.Verification
The grep should produce no output.
Dependencies
None.