- Remove windowId from IInitData

- Send exthost logs location from renderer
- IExtensionService: Expose an API to get exthost logs location
This commit is contained in:
Sandeep Somavarapu
2018-09-04 18:39:22 +02:00
parent 8d0c573bf5
commit 810efbc85f
10 changed files with 66 additions and 46 deletions

View File

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

View File

@@ -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 {

View File

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