Skip to content

Expose log level and log path to extensions #40053

@mjbvz

Description

@mjbvz

Problem
The TS extension currently provides its own logging logic to write TSServer events to a file on the disk. We would like to allow extensions like TS to make use of the new logging infrastructure that was added VS Code 1.19, so that logs from both core and extensions can be written to a common logging directory

Proposed API
Add two new properties on ExtensionContext:

export interface ExtensionContext {
    ...

    loggingLevel: LoggingLevel;

    loggingDirectory: string;
}

The loggingDirectory would be unique to each extension and created when the extension first accesses the property. This prevents two extensions from overwriting each other if both use a file called log for example

Metadata

Metadata

Labels

apiunder-discussionIssue is under discussion for relevance, priority, approach

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions