Skip to content

Ability to set log levels by output channel #223536

@rudyflores

Description

@rudyflores

I been working on an extensions that utilizes the OutputChannel API for logging things into the output view for different log levels such as: INFO, ERROR, etc...

Each of these loggers output independent information from each other, let's call this logger A and logger B. My feature request is the possibility to allow setting an individual log level at a per logger basis, so for example logger A could have a DEBUG level and logger B could have a TRACE level logging occur. This could be further enanced by using the set log level (as it works today) if the log level is not specified for that specific logger upon creation.

This is what I envision this API to look like:

// Case where log level is defined
const outputChannel = vscode.window.createOutputChannel('loggerA', { log: true }, 'DEBUG');

// Case where log level is not defined (will use default log level)
const outputChannel = vscode.window.createOutputChannel('loggerB', { log: true });

And even perhaps add a way to update this later with something like:

outputChannel.setLogLevel('TRACE');

For setting these log level a user can perhaps even use this enumerator from VS Code's docs: https://code.visualstudio.com/api/references/vscode-api#LogLevel

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalitylogVS Code log issues

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions