This commit is contained in:
Sandeep Somavarapu 2022-11-09 16:28:27 +01:00 committed by GitHub
parent 71f6e26bfd
commit 2cd8ea24f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 124 additions and 118 deletions

View file

@ -20,8 +20,7 @@
"scmValidation",
"tabInputTextMerge",
"timeline",
"contribMergeEditorMenus",
"extensionLog"
"contribMergeEditorMenus"
],
"categories": [
"Other"

View file

@ -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",

View file

@ -52,8 +52,7 @@
}
},
"enabledApiProposals": [
"telemetryLogger",
"extensionLog"
"telemetryLogger"
],
"aiKey": "0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",
"main": "./out/extension.js",

View file

@ -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"
]
}

View file

@ -17,8 +17,7 @@
],
"enabledApiProposals": [
"telemetryLogger",
"idToken",
"extensionLog"
"idToken"
],
"capabilities": {
"virtualWorkspaces": true,

View file

@ -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"
]
}

View file

@ -43,8 +43,7 @@
"treeItemCheckbox",
"treeViewReveal",
"workspaceTrust",
"telemetry",
"extensionLog"
"telemetry"
],
"private": true,
"activationEvents": [],

View file

@ -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;
}
};

View file

@ -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');

View file

@ -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',

View file

@ -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<LogLevel>;
/**
* 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<Uri>;
/**
* 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<LogLevel>;
}
/**
@ -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.
*

View file

@ -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<LogLevel>;
}
/**
* 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<LogLevel>;
/**
* 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;
}
}