Skip to content

[log] Add debug logging to 5 Go files#26738

Merged
pelikhan merged 1 commit intomainfrom
add-debug-logging-to-5-files-04ec1dc01eb755d4
Apr 16, 2026
Merged

[log] Add debug logging to 5 Go files#26738
pelikhan merged 1 commit intomainfrom
add-debug-logging-to-5-files-04ec1dc01eb755d4

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Adds meaningful debug logging to 5 Go files that previously had no logging, improving troubleshooting capability when DEBUG=* or DEBUG=workflow:* is set.

Files changed

File Logger name What's logged
pkg/workflow/mcp_cli_mount.go workflow:mcp_cli_mount Feature flag gate, server list selection, mount step generation
pkg/workflow/mcp_property_validation.go workflow:mcp_property_validation Per-tool entry, explicit vs inferred MCP type
pkg/workflow/build_input_schema.go workflow:build_input_schema Input count, per-input type/required, final property/required counts
pkg/cli/gateway_logs_mcp.go reuses cli:gateway_logs Log source selection (gateway.jsonl vs rpc-messages.jsonl), tool call counts, summary stats
pkg/cli/logs_report_firewall.go cli:logs_report_firewall Run count, final allowed/blocked domain counts after aggregation

Design notes

  • All log arguments are pure reads — no function calls that could cause side effects
  • Follows the established pkg:filename naming convention
  • gateway_logs_mcp.go reuses the package-level gatewayLogsLog from gateway_logs_types.go (no new logger needed)
  • Maximum 5 logging calls added per file; focused on entry points and key control-flow decisions

Test plan

  • make build — no compilation errors
  • All non-WASM unit tests pass (go test ./pkg/workflow/... ./pkg/cli/... -run 'Test[^W]')
  • Pre-existing WASM golden test failures confirmed unrelated to these changes (fail identically on main)
  • Enable with DEBUG=workflow:mcp_cli_mount,workflow:build_input_schema,workflow:mcp_property_validation or DEBUG=*

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

Generated by Go Logger Enhancement · ● 1.2M ·

  • expires on Apr 18, 2026, 9:36 PM UTC

- pkg/workflow/mcp_cli_mount.go: Add mcpCLIMountLog to trace MCP server
  selection decisions (feature flag checks, server list, mount step generation)
- pkg/workflow/mcp_property_validation.go: Add mcpPropertyValidationLog to
  trace MCP type validation (explicit vs inferred type, per-tool validation entry)
- pkg/workflow/build_input_schema.go: Add buildInputSchemaLog to trace input
  schema generation (per-input type/required, final property counts)
- pkg/cli/gateway_logs_mcp.go: Reuse existing gatewayLogsLog to trace MCP tool
  usage extraction (log source selection, tool call counts, summary stats)
- pkg/cli/logs_report_firewall.go: Add firewallReportLog to trace domain
  aggregation across runs (run count, final allowed/blocked domain counts)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added automation enhancement New feature or request labels Apr 16, 2026
@pelikhan pelikhan merged commit 6ce0d55 into main Apr 16, 2026
@pelikhan pelikhan deleted the add-debug-logging-to-5-files-04ec1dc01eb755d4 branch April 16, 2026 21: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