...

Command checklog

Command checklog reports unguarded common.Log.Trace and common.Log.Debug calls with variadic arguments inside for/range loop bodies.

In Go, `func(format string, args ...interface{})` boxes every non-pointer arg into interface{} at the call site. DummyLogger (the default) discards everything, but the boxing still happens. The fix is to wrap such calls with `if common.Log.IsLogLevel(common.LogLevel*) { ... }` so they short-circuit in production.

Usage:

go run ./internal/tools/checklog [path]

Default path is ".". Reports offending call sites, one per line. Exits non-zero if any findings (useful for CI gating).