Route extension logs through the BrightScript Extension output channel#802
Draft
chrisdp wants to merge 1 commit into
Draft
Route extension logs through the BrightScript Extension output channel#802chrisdp wants to merge 1 commit into
chrisdp wants to merge 1 commit 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.
Member
There was a problem hiding this comment.
BrighterScript and roku-debug both call this file logging.ts, let's standardize on that.
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/extensionLogger.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.LanguageServerManageras a proof of concept:console.log/console.error→logger.info/logger.error, plus aLanguageServerManager-prefixed sub-logger so messages are tagged in the output channel.Motivation
End-users currently can't see extension logs — the ~60
console.*calls scattered across the source only surface in the Extension Host devtools. This PR puts the plumbing in place so we can move those call sites over without each one needing to know about the output channel.Why a draft / what's not here
Posting this for maintainer feedback on the approach before doing the wider sweep. Specifically:
@rokucommunity/loggerthe right backbone, or should this use aLogOutputChannel(VS Code's built-in level-aware channel) instead?brightscript.logLevelsetting to control verbosity?extensionLogger.tsvs putting it onutilvs something else?If the approach is good, the follow-up is a mechanical migration of the remaining ~55
console.*calls acrossBrightScriptCommands,DebugConfigurationProvider,DeclarationProvider,LogOutputManager, etc.