diff --git a/extensions/git/package.json b/extensions/git/package.json index 6259fec2448a9..d5d23c49b3b86 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -20,8 +20,7 @@ "scmValidation", "tabInputTextMerge", "timeline", - "contribMergeEditorMenus", - "extensionLog" + "contribMergeEditorMenus" ], "categories": [ "Other" diff --git a/extensions/git/tsconfig.json b/extensions/git/tsconfig.json index 735a92b0b7198..c62c25401f27e 100644 --- a/extensions/git/tsconfig.json +++ b/extensions/git/tsconfig.json @@ -11,7 +11,6 @@ "src/**/*", "../../src/vscode-dts/vscode.d.ts", "../../src/vscode-dts/vscode.proposed.diffCommand.d.ts", - "../../src/vscode-dts/vscode.proposed.extensionLog.d.ts", "../../src/vscode-dts/vscode.proposed.scmActionButton.d.ts", "../../src/vscode-dts/vscode.proposed.scmSelectedProvider.d.ts", "../../src/vscode-dts/vscode.proposed.scmValidation.d.ts", diff --git a/extensions/github-authentication/package.json b/extensions/github-authentication/package.json index ca603e64f548d..76bf2670bd16f 100644 --- a/extensions/github-authentication/package.json +++ b/extensions/github-authentication/package.json @@ -52,8 +52,7 @@ } }, "enabledApiProposals": [ - "telemetryLogger", - "extensionLog" + "telemetryLogger" ], "aiKey": "0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255", "main": "./out/extension.js", diff --git a/extensions/github-authentication/tsconfig.json b/extensions/github-authentication/tsconfig.json index 1188d9a05f1b2..5e4713e9f3bc5 100644 --- a/extensions/github-authentication/tsconfig.json +++ b/extensions/github-authentication/tsconfig.json @@ -12,7 +12,6 @@ }, "include": [ "src/**/*", - "../../src/vscode-dts/vscode.d.ts", - "../../src/vscode-dts/vscode.proposed.extensionLog.d.ts" + "../../src/vscode-dts/vscode.d.ts" ] } diff --git a/extensions/microsoft-authentication/package.json b/extensions/microsoft-authentication/package.json index bba940e64d59f..86caf8a385ae8 100644 --- a/extensions/microsoft-authentication/package.json +++ b/extensions/microsoft-authentication/package.json @@ -17,8 +17,7 @@ ], "enabledApiProposals": [ "telemetryLogger", - "idToken", - "extensionLog" + "idToken" ], "capabilities": { "virtualWorkspaces": true, diff --git a/extensions/microsoft-authentication/tsconfig.json b/extensions/microsoft-authentication/tsconfig.json index 7f93087852353..4b9d06d1847ef 100644 --- a/extensions/microsoft-authentication/tsconfig.json +++ b/extensions/microsoft-authentication/tsconfig.json @@ -22,7 +22,6 @@ "include": [ "src/**/*", "../../src/vscode-dts/vscode.d.ts", - "../../src/vscode-dts/vscode.proposed.idToken.d.ts", - "../../src/vscode-dts/vscode.proposed.extensionLog.d.ts" + "../../src/vscode-dts/vscode.proposed.idToken.d.ts" ] } diff --git a/extensions/vscode-api-tests/package.json b/extensions/vscode-api-tests/package.json index cb55247e8ccd3..13243b4ae2f4c 100644 --- a/extensions/vscode-api-tests/package.json +++ b/extensions/vscode-api-tests/package.json @@ -43,8 +43,7 @@ "treeItemCheckbox", "treeViewReveal", "workspaceTrust", - "telemetry", - "extensionLog" + "telemetry" ], "private": true, "activationEvents": [], diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index 67cd07bbe3917..7ee462a5d5f15 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -367,11 +367,9 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I return initData.uiKind; }, get logLevel() { - checkProposedApiEnabled(extension, 'extensionLog'); return extHostLogService.getLevel(); }, get onDidChangeLogLevel() { - checkProposedApiEnabled(extension, 'extensionLog'); return extHostLogService.onDidChangeLogLevel; } }; diff --git a/src/vs/workbench/api/common/extHostOutput.ts b/src/vs/workbench/api/common/extHostOutput.ts index c3c8afbb886aa..ff20e8e445d68 100644 --- a/src/vs/workbench/api/common/extHostOutput.ts +++ b/src/vs/workbench/api/common/extHostOutput.ts @@ -20,7 +20,6 @@ import { isString } from 'vs/base/common/types'; import { FileSystemProviderErrorCode, toFileSystemProviderErrorCode } from 'vs/platform/files/common/files'; import { Emitter } from 'vs/base/common/event'; import { DisposableStore } from 'vs/base/common/lifecycle'; -import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; class ExtHostOutputChannel extends AbstractMessageLogger implements vscode.LogOutputChannel { @@ -144,9 +143,6 @@ export class ExtHostOutputService implements ExtHostOutputServiceShape { throw new Error('illegal argument `name`. must not be falsy'); } const log = typeof options === 'object' && options.log; - if (log) { - checkProposedApiEnabled(extension, 'extensionLog'); - } const languageId = isString(options) ? options : undefined; if (isString(languageId) && !languageId.trim()) { throw new Error('illegal argument `languageId`. must not be empty'); diff --git a/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts b/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts index 2bdb847696809..28c74167c4a22 100644 --- a/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts +++ b/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts @@ -28,7 +28,6 @@ export const allApiProposals = Object.freeze({ editSessionIdentityProvider: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts', editorInsets: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorInsets.d.ts', envShellEvent: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.envShellEvent.d.ts', - extensionLog: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionLog.d.ts', extensionRuntime: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionRuntime.d.ts', extensionsAny: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionsAny.d.ts', externalUriOpener: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.externalUriOpener.d.ts', diff --git a/src/vscode-dts/vscode.d.ts b/src/vscode-dts/vscode.d.ts index 3e9608b29af73..7399790e37523 100644 --- a/src/vscode-dts/vscode.d.ts +++ b/src/vscode-dts/vscode.d.ts @@ -6463,6 +6463,70 @@ declare module 'vscode' { dispose(): void; } + /** + * A channel for containing log output. + * + * To get an instance of an `LogOutputChannel` use + * {@link window.createOutputChannel createOutputChannel}. + */ + export interface LogOutputChannel extends OutputChannel { + + /** + * The current log level of the channel. Defaults to {@link env.logLevel editor log level}. + */ + readonly logLevel: LogLevel; + + /** + * An {@link Event} which fires when the log level of the channel changes. + */ + readonly onDidChangeLogLevel: Event; + + /** + * Outputs the given trace message to the channel. Use this method to log verbose information. + * + * The message is only loggeed if the channel is configured to display {@link LogLevel.Trace trace} log level. + * + * @param message trace message to log + */ + trace(message: string, ...args: any[]): void; + + /** + * Outputs the given debug message to the channel. + * + * The message is only loggeed if the channel is configured to display {@link LogLevel.Debug debug} log level or lower. + * + * @param message debug message to log + */ + debug(message: string, ...args: any[]): void; + + /** + * Outputs the given information message to the channel. + * + * The message is only loggeed if the channel is configured to display {@link LogLevel.Info info} log level or lower. + * + * @param message info message to log + */ + info(message: string, ...args: any[]): void; + + /** + * Outputs the given warning message to the channel. + * + * The message is only loggeed if the channel is configured to display {@link LogLevel.Warning warning} log level or lower. + * + * @param message warning message to log + */ + warn(message: string, ...args: any[]): void; + + /** + * Outputs the given error or error message to the channel. + * + * The message is only loggeed if the channel is configured to display {@link LogLevel.Error error} log level or lower. + * + * @param error Error or error message to log + */ + error(error: string | Error, ...args: any[]): void; + } + /** * Accessibility information which controls screen reader behavior. */ @@ -9191,6 +9255,42 @@ declare module 'vscode' { Web = 2 } + /** + * Log levels + */ + export enum LogLevel { + + /** + * No messages are logged with this level. + */ + Off = 0, + + /** + * All messages are logged with this level. + */ + Trace = 1, + + /** + * Messages with debug and higher log level are logged with this level. + */ + Debug = 2, + + /** + * Messages with info and higher log level are logged with this level. + */ + Info = 3, + + /** + * Messages with warning and higher log level are logged with this level. + */ + Warning = 4, + + /** + * Only error messages are logged with this level. + */ + Error = 5 + } + /** * Namespace describing the environment the editor runs in. */ @@ -9355,6 +9455,16 @@ declare module 'vscode' { * @return A uri that can be used on the client machine. */ export function asExternalUri(target: Uri): Thenable; + + /** + * The current log level of the editor. + */ + export const logLevel: LogLevel; + + /** + * An {@link Event} which fires when the log level of the editor changes. + */ + export const onDidChangeLogLevel: Event; } /** @@ -9920,6 +10030,14 @@ declare module 'vscode' { */ export function createOutputChannel(name: string, languageId?: string): OutputChannel; + /** + * Creates a new {@link LogOutputChannel log output channel} with the given name. + * + * @param name Human-readable string which will be used to represent the channel in the UI. + * @param options Options for the log output channel. + */ + export function createOutputChannel(name: string, options: { log: true }): LogOutputChannel; + /** * Create and show a new webview panel. * diff --git a/src/vscode-dts/vscode.proposed.extensionLog.d.ts b/src/vscode-dts/vscode.proposed.extensionLog.d.ts deleted file mode 100644 index 1dfb8f63a223e..0000000000000 --- a/src/vscode-dts/vscode.proposed.extensionLog.d.ts +++ /dev/null @@ -1,98 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -declare module 'vscode' { - - export enum LogLevel { - Off = 0, - Trace = 1, - Debug = 2, - Info = 3, - Warning = 4, - Error = 5, - } - - export namespace env { - - /** - * The current log level of the application. - */ - export const logLevel: LogLevel; - - /** - * An {@link Event} which fires when the log level of the application changes. - */ - export const onDidChangeLogLevel: Event; - - } - - /** - * A channel for containing log output. - */ - export interface LogOutputChannel extends OutputChannel { - - /** - * The current log level of the channel. Defaults to application {@link env.logLevel application log level}. - */ - readonly logLevel: LogLevel; - - /** - * An {@link Event} which fires when the log level of the channel changes. - */ - readonly onDidChangeLogLevel: Event; - - /** - * Log the given trace message to the channel. - * - * Messages are only logged when the {@link LogOutputChannel.logLevel log level} is {@link LogLevel.Trace trace}. - * - * @param message trace message to log - */ - trace(message: string, ...args: any[]): void; - /** - * Log the given debug message to the channel. - * - * Messages are only logged when the {@link LogOutputChannel.logLevel log level} is {@link LogLevel.Debug debug} or lower. - * - * @param message debug message to log - */ - debug(message: string, ...args: any[]): void; - /** - * Log the given info message to the channel. - * - * Messages are only logged when the {@link LogOutputChannel.logLevel log level} is {@link LogLevel.Info info} or lower. - * - * @param message info message to log - */ - info(message: string, ...args: any[]): void; - /** - * Log the given warning message to the channel. - * - * Messages are only logged when the {@link LogOutputChannel.logLevel log level} is {@link LogLevel.Warn warn} or lower. - * - * @param message warning message to log - */ - warn(message: string, ...args: any[]): void; - /** - * Log the given error or error message to the channel. - * - * Messages are only logged when the {@link LogOutputChannel.logLevel log level} is {@link LogLevel.Error error} or lower. - * - * @param error Error or error message to log - */ - error(error: string | Error, ...args: any[]): void; - } - - export namespace window { - /** - * Creates a new {@link LogOutputChannel log output channel} with the given name. - * - * @param name Human-readable string which will be used to represent the channel in the UI. - * @param options Options for the log output channel. - */ - export function createOutputChannel(name: string, options: { readonly log: true }): LogOutputChannel; - } - -}