Skip to content

[log] Add debug logging to parser, workflow, and cli packages#19110

Merged
pelikhan merged 2 commits intomainfrom
add-debug-logging-to-parser-workflow-cli-33268f495d8cdfd3
Mar 1, 2026
Merged

[log] Add debug logging to parser, workflow, and cli packages#19110
pelikhan merged 2 commits intomainfrom
add-debug-logging-to-parser-workflow-cli-33268f495d8cdfd3

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Mar 1, 2026

Enhance five files with meaningful debug logging to improve troubleshooting and developer visibility. All changes use existing named loggers where available and follow the project's pkg:filename naming convention.

Changes

pkg/parser/schedule_cron_detection.go — uses package-level log from frontmatter.go

  • IsDailyCron: log when a cron expression is classified as daily (minute/hour values)
  • IsHourlyCron: log when a cron expression is classified as hourly
  • IsCronExpression: log when input is rejected due to incorrect field count

pkg/parser/import_cycle.go — uses existing importLog from import_processor.go

  • findCyclePath: log cycle node count, DFS start node, found path, and fallback case
  • dfsForCycle: log when the cycle back-edge is detected (current -> target)

pkg/parser/schema_compiler.go — uses existing schemaCompilerLog

  • validateWithSchema: log context and field count on entry, which cached schema is selected, validation failure details, and success confirmation

pkg/workflow/codex_mcp.go — uses existing codexMCPLog

  • renderCodexMCPConfigWithContext: log tool name and localhost-rewrite flag before TOML rendering; log errors
  • renderCodexJSONMCPConfigWithContext: log tool name, isLast, and localhost-rewrite flag before JSON rendering; log errors

pkg/cli/deps_report.go — uses existing depsReportLog

  • parseGoModWithIndirect: log file path on entry and parsed dependency count on exit
  • DisplayDependencyReportJSON: log summary counts before generating JSON output

Quality checklist

  • Maximum 5 files modified
  • No test files modified
  • Logger arguments have no side effects
  • Logging messages are meaningful
  • No duplicate logging with existing calls
  • Import statements unchanged (existing loggers used)
  • make build passes (no compilation errors)
  • go test ./pkg/parser/... passes
  • go vet ./pkg/parser/... ./pkg/workflow/... ./pkg/cli/... passes

🤖 Generated with [Claude Code]((claude.com/redacted)

Generated by Go Logger Enhancement

  • expires on Mar 3, 2026, 8:27 PM UTC

Enhance five files with meaningful debug logging to improve troubleshooting:

- pkg/parser/schedule_cron_detection.go: log cron classification results
  (daily/hourly) and invalid expression detection
- pkg/parser/import_cycle.go: log DFS cycle detection traversal using
  existing importLog, including cycle path discovery
- pkg/parser/schema_compiler.go: log schema selection and validation
  outcomes in validateWithSchema using schemaCompilerLog
- pkg/workflow/codex_mcp.go: log TOML and JSON MCP config rendering for
  custom tools with rewrite_localhost context using codexMCPLog
- pkg/cli/deps_report.go: log go.mod parsing and JSON report generation
  using depsReportLog

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added automation enhancement New feature or request labels Mar 1, 2026
@pelikhan pelikhan merged commit deb2230 into main Mar 1, 2026
48 checks passed
@pelikhan pelikhan deleted the add-debug-logging-to-parser-workflow-cli-33268f495d8cdfd3 branch March 1, 2026 20:36
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.

2 participants