[log] Add debug logging to core compilation and CLI files#3860
Merged
Conversation
Enhanced 5 core files with comprehensive debug logging to improve troubleshooting and development workflow visibility: 1. **pkg/workflow/compiler_yaml.go**: - Added logging to generateMainJobSteps with workflow name - Log checkout step decision - Log runtime requirements detection with counts - Log engine installation steps with engine ID - Log prompt generation with content size - Log prompt chunking with chunk count 2. **pkg/workflow/expressions.go**: - Added logging to tokenize with expression length - Log buildConditionTree with existing and draft conditions - Log condition combination logic (AND vs draft-only) - Log buildReactionCondition for multiple event types - Log parsePrimaryExpression with token details (using Enabled() check) 3. **pkg/workflow/safe_outputs.go**: - Added logging to buildSafeOutputJob with job name - Log pre-steps count - Log job condition decision (custom vs default) - Log job needs/dependencies - Log generateSafeOutputsPromptSection entry - Log generateSafeOutputsConfig entry 4. **pkg/workflow/mcp-config.go**: - Added logging to getMCPConfig for MCP type detection - Log inferred type for http/stdio/container - Log field extraction phase with MCP type - Log renderCustomMCPConfigWrapper with tool name 5. **pkg/cli/compile_command.go**: - Added logging for validation enabled/disabled status - Log no-emit mode status - Log file compilation count at start - Log compileAllWorkflowFiles directory entry - Log markdown file count found in directory All logging follows project guidelines: - Uses existing logger declarations (all files already had loggers) - Logger arguments have no side effects - Uses Enabled() check for potentially expensive debug info - Focuses on function entry, control flow, and key decisions - Messages are meaningful and helpful for debugging Validated: - All files compile successfully (make build) - Debug logging works correctly (DEBUG=* ./gh-aw compile dev) - Cache updated with processed files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Enhanced 5 core compilation and CLI files with comprehensive debug logging to improve troubleshooting and development workflow visibility. This is the third session of logging enhancements, focusing on the main compilation pipeline files.
Files Enhanced
pkg/workflow/compiler_yaml.go (6 logging additions)
pkg/workflow/expressions.go (5 logging additions)
pkg/workflow/safe_outputs.go (6 logging additions)
pkg/workflow/mcp-config.go (4 logging additions)
pkg/cli/compile_command.go (5 logging additions)
Quality Assurance
✅ All files already had logger declarations (no new loggers needed)
✅ Logger arguments have no side effects
✅ Uses
log.Enabled()check for expensive debug info✅ All logging follows project guidelines from AGENTS.md
✅ No test files modified
✅ Validated with
make build(successful compilation)✅ Tested with
DEBUG=* ./gh-aw compile dev(logging works correctly)✅ Cache updated with processed files
Debug Output Sample
Impact
This PR enhances debugging capabilities for the core compilation pipeline, making it easier to:
Related Work
Total: 15 files enhanced across 3 sessions
🤖 Generated with Claude Code