Skip to content

[log] Add debug logging to 5 pkg/ files#42640

Merged
pelikhan merged 1 commit into
mainfrom
add-debug-logging-pkg-e5ac325474530a56
Jul 1, 2026
Merged

[log] Add debug logging to 5 pkg/ files#42640
pelikhan merged 1 commit into
mainfrom
add-debug-logging-pkg-e5ac325474530a56

Conversation

@github-actions

@github-actions github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds structured debug logging to 5 pkg/ files using the existing pkg/logger package. All changes are observability-only; no logic is modified.

Changes

File Logger name Log points added
pkg/cli/logs_usage_activity.go cli:logs_usage_activity 5
pkg/importinpututil/import_input.go importinpututil:import_input 5
pkg/intent/resolver.go intent:resolver 8
pkg/workflow/lsp_validation.go workflow:lsp_validation 3
pkg/workflow/skills_frontmatter.go workflow:skills_frontmatter 3
Per-file details

pkg/cli/logs_usage_activity.go

  • loadUsageActivitySummary: logs JSON parse failure, schema mismatch (with expected/actual values), and successful load path.
  • applyUsageActivitySummaryToResult: logs firewall analysis backfill (total/allowed/blocked request counts) and MCP tool usage backfill (server count).

pkg/importinpututil/import_input.go

  • ResolvePathValue: logs top-level key lookup result, parent key not found, parent key not a map[string]any, and dotted sub-key lookup result.
  • FormatResolvedValue: logs the nil-value early-exit branch.

pkg/intent/resolver.go

  • ResolvePullRequest: logs entry parameters (nodeID, explicitIntent present, closing issue count, label count) and each resolution branch (explicit metadata, single closing issue, label fallback, unlinked, ambiguous).
  • ResolveIssue: logs entry parameters and the no-labels unlinked branch.

pkg/workflow/lsp_validation.go

  • validateLSPSupport: logs entry (LSP config count), unsupported engine rejection, and validation success.

pkg/workflow/skills_frontmatter.go

  • validateFrontmatterSkills: logs entry with skill entry count.
  • parseRawSkillReferences: logs entry with raw skill count and final parsed ref count.

Pattern

Each file follows the same convention:

var <name>Log = logger.New("<package>:<file>")

Log calls use Printf (formatted) or Print (plain) and are placed at key decision points — successful paths, error/skip branches, and backfill triggers — to support debug tracing without changing runtime behaviour.

Testing

No new tests required. Existing tests cover the unchanged logic; debug log output is gated behind the logger's debug level and does not affect observable behaviour.

Generated by PR Description Updater for #42640 · 52.8 AIC · ⌖ 6.8 AIC · ⊞ 4.7K ·

Add namespace-based debug loggers (logger.New with pkg:filename naming)
and meaningful debug calls at control-flow decisions and state changes:

- intent/resolver.go: attribution source decisions in ResolvePullRequest/ResolveIssue
- workflow/skills_frontmatter.go: skill validation and parsing counts
- cli/logs_usage_activity.go: summary load path/schema fallback and backfill
- importinpututil/import_input.go: import input path resolution outcomes
- workflow/lsp_validation.go: LSP support validation decisions

Logger arguments only read fields / call len(); no side effects.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added automation enhancement New feature or request labels Jul 1, 2026
@pelikhan pelikhan merged commit 74f5dc6 into main Jul 1, 2026
@pelikhan pelikhan deleted the add-debug-logging-pkg-e5ac325474530a56 branch July 1, 2026 05:02
@github-actions github-actions Bot mentioned this pull request Jul 1, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

🎉 This pull request is included in a new release.

Release: v0.82.2

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