mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 11:38:51 +01:00
- Remove windowId from IInitData
- Send exthost logs location from renderer - IExtensionService: Expose an API to get exthost logs location
This commit is contained in:
@@ -138,8 +138,8 @@ export function createApiFactory(
|
||||
const extHostMessageService = new ExtHostMessageService(rpcProtocol);
|
||||
const extHostDialogs = new ExtHostDialogs(rpcProtocol);
|
||||
const extHostStatusBar = new ExtHostStatusBar(rpcProtocol);
|
||||
const outputDir = posix.join(initData.logsPath, `output_logging_${initData.windowId}_${toLocalISOString(new Date()).replace(/-|:|\.\d+Z$/g, '')}`);
|
||||
const extHostOutputService = new ExtHostOutputService(outputDir, rpcProtocol);
|
||||
const outputPath = posix.join(initData.logsLocation.fsPath, `output_logging_${toLocalISOString(new Date()).replace(/-|:|\.\d+Z$/g, '')}`);
|
||||
const extHostOutputService = new ExtHostOutputService(outputPath, rpcProtocol);
|
||||
const extHostLanguages = new ExtHostLanguages(rpcProtocol);
|
||||
|
||||
// Register API-ish commands
|
||||
|
||||
@@ -66,9 +66,8 @@ export interface IInitData {
|
||||
extensions: IExtensionDescription[];
|
||||
configuration: IConfigurationInitData;
|
||||
telemetryInfo: ITelemetryInfo;
|
||||
windowId: number;
|
||||
logLevel: LogLevel;
|
||||
logsPath: string;
|
||||
logsLocation: URI;
|
||||
}
|
||||
|
||||
export interface IConfigurationInitData extends IConfigurationData {
|
||||
|
||||
@@ -9,16 +9,19 @@ import { LogLevel } from 'vs/workbench/api/node/extHostTypes';
|
||||
import { ILogService, DelegatedLogService } 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';
|
||||
|
||||
|
||||
export class ExtHostLogService extends DelegatedLogService implements ILogService, ExtHostLogServiceShape {
|
||||
|
||||
private _logsPath: string;
|
||||
|
||||
constructor(
|
||||
private _windowId: number,
|
||||
logLevel: LogLevel,
|
||||
private _logsPath: string
|
||||
logsPath: string,
|
||||
) {
|
||||
super(createSpdLogService(`exthost${_windowId}`, logLevel, _logsPath));
|
||||
super(createSpdLogService(ExtensionHostLogFileName, logLevel, logsPath));
|
||||
this._logsPath = logsPath;
|
||||
}
|
||||
|
||||
$setLevel(level: LogLevel): void {
|
||||
@@ -26,6 +29,6 @@ export class ExtHostLogService extends DelegatedLogService implements ILogServic
|
||||
}
|
||||
|
||||
getLogDirectory(extensionID: string): string {
|
||||
return join(this._logsPath, `${extensionID}_${this._windowId}`);
|
||||
return join(this._logsPath, extensionID);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user