Skip to content

Add debug logging via LogOutputChannel#350

Open
Copilot wants to merge 5 commits intomainfrom
copilot/add-debug-logging
Open

Add debug logging via LogOutputChannel#350
Copilot wants to merge 5 commits intomainfrom
copilot/add-debug-logging

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

  • Create centralized logger module (src/logger.ts) using vscode.LogOutputChannel
  • Initialize logger in src/extension.ts during activation
  • Replace existing console.error/console.warn calls with logger calls
  • Add debug logging to extension lifecycle, commands, detection, documents, status bar, API client, notifications, MCP server, and task provider
  • Add tests for the logger module
  • Validate with lint, compile, and compile-tests
  • Run code review and address feedback
  • Run security scan (CodeQL) — no issues found
  • Add changelog entry under [1.13.0] - Unreleased
  • Add debug logging documentation to README troubleshooting section
  • Fix 6 failing API client tests caused by closed LogOutputChannel throwing Error: Channel has been closed
Original prompt

This section details on the original issue you should resolve

<issue_title>Adding debug logging</issue_title>
<issue_description>We should add debug logging to show in the Debug Console to help investigating issues.

</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add debug logging to help investigate issues Add debug logging via LogOutputChannel Feb 27, 2026
@garrytrinder
Copy link
Member

@copilot update this PR to include changelog and readme updates following the guidelines in AGENTS.md

Copy link
Contributor Author

Copilot AI commented Feb 27, 2026

@copilot update this PR to include changelog and readme updates following the guidelines in AGENTS.md

Added in 5b365a3:

  • CHANGELOG.md: new entry under [1.13.0] - UnreleasedAdded for the debug logging feature
  • README.md: added "View debug logs" guidance to the Troubleshooting section

@garrytrinder
Copy link
Member

@copilot fix the failing tests

Copy link
Contributor Author

Copilot AI commented Feb 27, 2026

@copilot fix the failing tests

Fixed in a900441. The 6 failing API client tests were caused by logger.debug() calls hitting a closed LogOutputChannel during test execution. Wrapped all logger function calls in try-catch blocks so they gracefully handle the Error: Channel has been closed case.

Copilot AI and others added 5 commits March 2, 2026 10:10
- Create src/logger.ts with leveled logging (trace/debug/info/warn/error)
- Initialize logger during extension activation
- Replace all console.error/warn calls with logger equivalents
- Add debug logging to extension lifecycle, detect, state, documents,
  status-bar, API client, proxy commands, recording, notifications,
  MCP server, and task provider
- Add logger test suite

Co-authored-by: garrytrinder <11563347+garrytrinder@users.noreply.github.com>
…xposing full paths

Co-authored-by: garrytrinder <11563347+garrytrinder@users.noreply.github.com>
Co-authored-by: garrytrinder <11563347+garrytrinder@users.noreply.github.com>
Co-authored-by: garrytrinder <11563347+garrytrinder@users.noreply.github.com>
@garrytrinder garrytrinder force-pushed the copilot/add-debug-logging branch from a900441 to 6be82ef Compare March 2, 2026 10:10
@garrytrinder garrytrinder marked this pull request as ready for review March 2, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding debug logging

2 participants