Conversation
- Added logger import and declaration using 'main:main' namespace - Added 7 meaningful debug logging statements: - Log at application start - Log version string construction - Log version determination (ldflags vs dev) - Log git commit source (ldflags vs build info) - Log commit hash extraction from build info - Log before executing root command All logging follows project guidelines with no side effects in arguments.
|
Sanitize environment variables in Docker args logging
|
There was a problem hiding this comment.
Pull request overview
This PR enhances the main entry point (main.go) with debug logging statements to improve troubleshooting and development visibility during application startup and version string construction. The changes follow the project's logging guidelines and add meaningful debug information without impacting runtime behavior when debug logging is disabled.
Changes:
- Added logger import and declaration for debug logging in main.go
- Added 7 debug log statements tracking application lifecycle, version determination, and build metadata extraction
- Enhanced visibility into version string construction process for debugging purposes
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "github.com/github/gh-aw-mcpg/internal/logger" | ||
| ) | ||
|
|
||
| var log = logger.New("main:main") |
There was a problem hiding this comment.
The logger variable should use a descriptive name following the established codebase convention. The majority of the codebase (20 out of 23 logger declarations) uses descriptive names like logLauncher, logValidation, logMiddleware, etc. The AGENTS.md guidelines (line 312) explicitly state that descriptive names are "preferred" and generic log is only "acceptable for simple cases."
Recommended change: var logMain = logger.New("main:main") to align with the predominant pattern in the codebase and improve clarity, especially since main.go imports the standard library's fmt package which could potentially cause confusion if log were also imported in the future.
Summary
Enhanced
main.gowith debug logging to improve troubleshooting and development visibility.Changes Made
Added 7 meaningful debug logging statements:
Technical Details
"github.com/github/gh-aw-mcpg/internal/logger"var log = logger.New("main:main")main:main)Testing
To see the new debug logs in action:
DEBUG=main:* ./awmg --versionThis will show the version string construction process with all intermediate steps.
Quality Checklist
pkg:filenameconvention