Skip to content

[log] Add debug logging to parser and CLI compilation stats#7210

Merged
pelikhan merged 1 commit intomainfrom
main-5900bc6bca09d248
Dec 22, 2025
Merged

[log] Add debug logging to parser and CLI compilation stats#7210
pelikhan merged 1 commit intomainfrom
main-5900bc6bca09d248

Conversation

@github-actions
Copy link
Contributor

Summary

Enhanced 5 Go files with meaningful debug logging to improve troubleshooting and development workflows:

  • Parser package (4 files): Added logging to include processing, tool merging, and content extraction functions
  • CLI package (1 file): Added logging to workflow compilation statistics collection

All changes follow the project's logging guidelines from AGENTS.md and use the package-level loggers where appropriate.

Changes Made

Parser Package (pkg/parser/)

  1. tools_merger.go - Tool configuration merging

    • Log merge operations with content size and key counts
    • Log empty object detection
    • Log merge results
  2. include_processor.go - Include directive processing

    • Log include processing entry with parameters
    • Log path resolution failures
    • Log duplicate include detection
    • Log individual file processing
  3. include_expander.go - Recursive include expansion

    • Log expansion entry with parameters
    • Log recursion depth during expansion
    • Log completion with visited file count
  4. content_extractor.go - Frontmatter field extraction

    • Log tool extraction operations
    • Log frontmatter parsing failures
    • Log empty content detection
    • Log extracted configuration counts

CLI Package (pkg/cli/)

  1. compile_stats.go - Workflow statistics collection
    • Added new logger declaration: cli:compile_stats
    • Log stats collection entry and failures
    • Log job counts and final statistics
    • Log table display operations

Testing

  • Built successfully with make build (no compilation errors)
  • Tested with DEBUG=* ./gh-aw compile dev to verify logging output
  • Tested with DEBUG=* ./gh-aw compile dev --stats to verify stats logging
  • All new log messages appear correctly when debug logging is enabled

Quality Checklist

  • Maximum 5 files modified
  • No test files modified
  • Each file has proper logger declaration or uses package-level logger
  • Logger arguments don't compute anything or cause side effects
  • Logging messages are meaningful and helpful for debugging
  • No duplicate logging with existing logs
  • Import statements properly formatted
  • Changes validated with make build
  • Workflow compilation tested with debug logging enabled

Examples of New Debug Output

When running with DEBUG=*:

parser:frontmatter Expanding includes: baseDir=/path/to/workflows, extractTools=true, content_size=404
parser:frontmatter Merging tools from JSON: content_size=0 bytes
cli:compile_stats Collecting workflow stats: file=/path/to/workflow.lock.yml
cli:compile_stats Workflow has 5 jobs
cli:compile_stats Stats collected: jobs=5, steps=62, scripts=28, size=440546 bytes

Generated with [Claude Code]((redacted)

Co-Authored-By: Claude Sonnet 4.5 (noreply@anthropic.com)

AI generated by Go Logger Enhancement

Enhanced 5 Go files with meaningful debug logging:

Parser package:
- tools_merger.go: Log tool merging operations with metrics
- include_processor.go: Log include processing and resolution
- include_expander.go: Log recursive expansion depth and results
- content_extractor.go: Log tool extraction and parsing

CLI package:
- compile_stats.go: Added logger and stats collection logging

All changes follow project logging guidelines from AGENTS.md.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@github-actions github-actions bot added automation enhancement New feature or request labels Dec 22, 2025
@pelikhan pelikhan merged commit 35372a1 into main Dec 22, 2025
4 checks passed
@pelikhan pelikhan deleted the main-5900bc6bca09d248 branch December 22, 2025 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant