mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 10:38:59 +01:00
Fix #64273 - EH log levels start at 1
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
import { localize } from 'vs/nls';
|
||||
import { CancellationTokenSource } from 'vs/base/common/cancellation';
|
||||
import * as errors from 'vs/base/common/errors';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { Emitter, mapEvent } from 'vs/base/common/event';
|
||||
import { TernarySearchTree } from 'vs/base/common/map';
|
||||
import * as paths from 'vs/base/common/paths';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
@@ -246,11 +246,11 @@ export function createApiFactory(
|
||||
get appRoot() { return initData.environment.appRoot.fsPath; },
|
||||
get logLevel() {
|
||||
checkProposedApiEnabled(extension);
|
||||
return extHostLogService.getLevel();
|
||||
return typeConverters.LogLevel.fromMainLogLevel(extHostLogService.getLevel());
|
||||
},
|
||||
get onDidChangeLogLevel() {
|
||||
checkProposedApiEnabled(extension);
|
||||
return extHostLogService.onDidChangeLogLevel;
|
||||
return mapEvent(extHostLogService.onDidChangeLogLevel, l => typeConverters.LogLevel.fromMainLogLevel(l));
|
||||
},
|
||||
get clipboard(): vscode.Clipboard {
|
||||
return extHostClipboard;
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { join } from 'vs/base/common/paths';
|
||||
import { LogLevel } from 'vs/workbench/api/node/extHostTypes';
|
||||
import { ILogService, DelegatedLogService } from 'vs/platform/log/common/log';
|
||||
import { ILogService, DelegatedLogService, LogLevel } from 'vs/platform/log/common/log';
|
||||
import { createSpdLogService } from 'vs/platform/log/node/spdlogService';
|
||||
import { ExtHostLogServiceShape } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import { ExtensionHostLogFileName } from 'vs/workbench/services/extensions/common/extensions';
|
||||
|
||||
@@ -27,6 +27,7 @@ import { isString, isNumber } from 'vs/base/common/types';
|
||||
import * as marked from 'vs/base/common/marked/marked';
|
||||
import { parse } from 'vs/base/common/marshalling';
|
||||
import { cloneAndChange } from 'vs/base/common/objects';
|
||||
import { LogLevel as _MainLogLevel } from 'vs/platform/log/common/log';
|
||||
|
||||
export interface PositionLike {
|
||||
line: number;
|
||||
@@ -967,3 +968,13 @@ export namespace LanguageSelector {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export namespace LogLevel {
|
||||
export function fromMainLogLevel(mainLevel: _MainLogLevel): types.LogLevel {
|
||||
return mainLevel + 1;
|
||||
}
|
||||
|
||||
export function toMainLogLevel(extLevel: types.LogLevel): _MainLogLevel {
|
||||
return extLevel - 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user