Skip to content

Route extension logs through the BrightScript Extension output channel#802

Draft
chrisdp wants to merge 1 commit into
masterfrom
feature/extension-logger
Draft

Route extension logs through the BrightScript Extension output channel#802
chrisdp wants to merge 1 commit into
masterfrom
feature/extension-logger

Conversation

@chrisdp

@chrisdp chrisdp commented May 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds src/extensionLogger.ts, a shared logger (built on @rokucommunity/logger) that writes to the developer console and to the existing BrightScript Extension output channel. The channel is already piped into the optional brightscript.extensionLogfilePath setting, so file logging works without further wiring.
  • Migrates LanguageServerManager as a proof of concept: console.log/console.errorlogger.info/logger.error, plus a LanguageServerManager-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:

  • Is @rokucommunity/logger the right backbone, or should this use a LogOutputChannel (VS Code's built-in level-aware channel) instead?
  • Should there be a brightscript.logLevel setting to control verbosity?
  • Naming — extensionLogger.ts vs putting it on util vs something else?

If the approach is good, the follow-up is a mechanical migration of the remaining ~55 console.* calls across BrightScriptCommands, DebugConfigurationProvider, DeclarationProvider, LogOutputManager, etc.

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.
Comment thread src/extensionLogger.ts

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BrighterScript and roku-debug both call this file logging.ts, let's standardize on that.

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.

2 participants