Route extension logs through the BrightScript Extension output channel - #802
Open
chrisdp wants to merge 5 commits into
Open
Route extension logs through the BrightScript Extension output channel#802chrisdp wants to merge 5 commits into
chrisdp wants to merge 5 commits into
Conversation
Adds a shared logger (built on @rokucommunity/logger) that writes to both the developer console and the BrightScript Extension output channel, so end-users can see extension logs without attaching a debugger. The channel is already wired to the optional brightscript.extensionLogfilePath sink, so file logging works automatically. LanguageServerManager is migrated as a proof of concept. The remaining console.* call sites can be moved over in a follow-up sweep.
…ions Also export a bound `createLogger` helper, matching the pattern used in brighterscript and roku-debug.
`logger.info` is below the shared logger's 'log' threshold in @rokucommunity/logger (error < warn < log < info), so the migrated onDidChangeState message was silently dropped. Use `logger.log` to preserve the original console.log behavior.
Mechanical mapping (console.log→logger.log, warn→warn, error→error) across 19 files, each with a component-named sub-logger. Commented-out console calls were updated too so they stay consistent if re-enabled. Skipped: the Perfetto webview inline script (runs in the webview, not the extension host) and webviews/ sources.
chrisdp
marked this pull request as ready for review
July 24, 2026 14:27
TwitchBronBron
approved these changes
Jul 29, 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.
Summary
src/logging.ts, a shared logger (built on@rokucommunity/logger) that writes to the developer console and to the existingBrightScript Extensionoutput channel. The channel is already piped into the optionalbrightscript.extensionLogfilePathsetting, so file logging works without further wiring.console.*calls across the extension source (~45 call sites in 19 files) to the shared logger, each file tagged with a component-named sub-logger (e.g.[LanguageServerManager]) so messages are attributable in the output channel.BrightScript Language Serveroutput channel — only extension-level logs route through the shared logger.Motivation
End-users currently can't see extension logs — the
console.*calls scattered across the source only surface in the Extension Host devtools. This routes them to theBrightScript Extensionoutput channel (and thus the logfile setting) without each call site needing to know about the channel.Notes
console.log→logger.log,warn→warn,error→error. (In@rokucommunity/logger,infois more verbose thanlog, sologger.infowould have been silently dropped at the defaultloglevel.)webviews/sources.brightscript.logLevelsetting to control verbosity? A few noisy call sites (e.g.DeviceManager.resolveDevicetracing) could then be demoted todebug/trace.