Log improvements (#163532)

* - expose log level in the proposed api
- ability to set log level per logger

* fix tests
This commit is contained in:
Sandeep Somavarapu
2022-10-13 12:48:52 +02:00
committed by GitHub
parent a78f7af399
commit 894aa9a7a7
30 changed files with 421 additions and 109 deletions

View File

@@ -59,7 +59,7 @@ import { IExtHostDecorations } from 'vs/workbench/api/common/extHostDecorations'
import { IExtHostTask } from 'vs/workbench/api/common/extHostTask';
import { IExtHostDebugService } from 'vs/workbench/api/common/extHostDebugService';
import { IExtHostSearch } from 'vs/workbench/api/common/extHostSearch';
import { ILoggerService, ILogService } from 'vs/platform/log/common/log';
import { ILoggerService, ILogService, LogLevel } from 'vs/platform/log/common/log';
import { IURITransformerService } from 'vs/workbench/api/common/extHostUriTransformerService';
import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService';
import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService';
@@ -364,6 +364,14 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
},
get uiKind() {
return initData.uiKind;
},
get logLevel() {
checkProposedApiEnabled(extension, 'extensionLog');
return extHostLogService.getLevel();
},
get onDidChangeLogLevel() {
checkProposedApiEnabled(extension, 'extensionLog');
return extHostLogService.onDidChangeLogLevel;
}
};
if (!initData.environment.extensionTestsLocationURI) {
@@ -1383,7 +1391,8 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
TabInputWebview: extHostTypes.WebviewEditorTabInput,
TabInputTerminal: extHostTypes.TerminalEditorTabInput,
TabInputInteractiveWindow: extHostTypes.InteractiveWindowInput,
TerminalExitReason: extHostTypes.TerminalExitReason
TerminalExitReason: extHostTypes.TerminalExitReason,
LogLevel: LogLevel,
};
};
}