Log Package Usage Violations
Category: Logging standardization
Scope: Library packages (pkg/)
Finding Count: 38 direct log.Printf/log.Print calls
Standard: Must use pkg/logger for all debug/diagnostic logging
Affected Files
- pkg/envutil/envutil.go - 2 violations (lines 33, 56)
- pkg/fileutil/fileutil.go - 9 violations (lines 40, 49, 53, 66, 85, 88, 134, 149, 152, 159, 167)
- pkg/gitutil/gitutil.go - 6 violations (lines 33, 44, 86, 90, 96, 100, 174, 179)
- pkg/typeutil/convert.go - 3 violations (lines 58, 66, 105)
- pkg/repoutil/repoutil.go - 3 violations (lines 16, 19, 22)
- pkg/semverutil/semverutil.go - 6 violations (lines 63, 67, 110, 112, 114, 149)
- pkg/workflow/create_entity_helpers.go - 2 violations (lines 61, 68)
- pkg/workflow/parse_helpers.go - 1 violation (line 34)
- pkg/cli/mcp_server_http.go - 2 violations (lines 42, 53)
Remediation Pattern
Current (WRONG)
import "log"
func someFunction() {
log.Printf("Something happened: %v", value)
}
New (CORRECT)
import "github.com/github/gh-aw/pkg/logger"
var log = logger.New("pkg:filename") // at package level
func someFunction() {
log.Printf("Something happened: %v", value) // Only when DEBUG matches
}
Remediation Checklist
Benefits
✅ Centralized debug logging control via DEBUG environment variable
✅ Consistent logging format and styling
✅ Zero overhead when DEBUG doesn't match category
✅ Supports wildcard patterns: DEBUG=pkg:* DEBUG=*,!fileutil:*
Expected Outcome
All library packages should use pkg/logger exclusively. No direct log.Printf or log.Print calls in pkg/ directories.
Created by: LintMonster
Report: Daily custom lint scan
Generated by 🧌 LintMonster · ● 601.6K · ◷
Log Package Usage Violations
Category: Logging standardization
Scope: Library packages (
pkg/)Finding Count: 38 direct log.Printf/log.Print calls
Standard: Must use
pkg/loggerfor all debug/diagnostic loggingAffected Files
Remediation Pattern
Current (WRONG)
New (CORRECT)
Remediation Checklist
github.com/github/gh-aw/pkg/loggerimport "log"var log = logger.New("pkg:filename")at package levellog.Printf()andlog.Print()calls (unchanged API)pkg:filename(e.g.,fileutil:fileutil,gitutil:gitutil)make golint-customto verify all violations are fixedmake test-unitto ensure no behavior changes (logging is debug-only)Benefits
✅ Centralized debug logging control via
DEBUGenvironment variable✅ Consistent logging format and styling
✅ Zero overhead when DEBUG doesn't match category
✅ Supports wildcard patterns:
DEBUG=pkg:* DEBUG=*,!fileutil:*Expected Outcome
All library packages should use
pkg/loggerexclusively. No directlog.Printforlog.Printcalls inpkg/directories.Created by: LintMonster
Report: Daily custom lint scan