Enable console.log to log to ILogService#313978
Merged
roblourens merged 4 commits intomainfrom May 5, 2026
Merged
Conversation
For easier agentic debugging
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a development-only path that forwards console.* output into each process's ILogService, so ad-hoc debugging via console.log can show up in VS Code's structured log files across the main/workbench/shared/agent/pty processes.
Changes:
- Added a new dev-only console forwarder in the shared logging layer and routed built-in console loggers through a recursion guard.
- Enabled that forwarder in several Electron/Node entrypoints so
console.*output can reach process log files during local development. - Updated main-thread extension-host console handling to send all extension-host console output to the log service in the same development scenario.
Show a summary per file
| File | Description |
|---|---|
src/vs/workbench/services/log/electron-browser/logService.ts |
Enables console forwarding in the native workbench window log service. |
src/vs/workbench/api/browser/mainThreadConsole.ts |
Changes extension-host console routing behavior when dev forwarding is enabled. |
src/vs/platform/terminal/node/ptyHostMain.ts |
Enables console forwarding in the pty host process. |
src/vs/platform/log/common/log.ts |
Introduces the console forwarder implementation and updates console logger emission paths. |
src/vs/platform/agentHost/node/agentHostMain.ts |
Enables console forwarding in the agent host process. |
src/vs/code/electron-utility/sharedProcess/sharedProcessMain.ts |
Enables console forwarding in the shared process. |
src/vs/code/electron-main/main.ts |
Enables console forwarding in the Electron main process. |
Copilot's findings
- Files reviewed: 7/7 changed files
- Comments generated: 2
Contributor
Screenshot ChangesBase: Changed (9)Errored (18)Fixtures that failed to render — no screenshot was produced.
|
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @deepak1556Matched files:
@anthonykim1Matched files:
|
TylerLeonhardt
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For easier agentic debugging