mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-15 01:25:36 -05:00
This reverts commit d15a3fcc98.
This commit is contained in:
@@ -30,6 +30,7 @@ import { AppInsightsAppender } from 'vs/platform/telemetry/node/appInsightsAppen
|
||||
import { IWindowsService, ActiveWindowManager } from 'vs/platform/windows/common/windows';
|
||||
import { WindowsService } from 'vs/platform/windows/electron-browser/windowsService';
|
||||
import { ipcRenderer } from 'electron';
|
||||
import { createBufferSpdLogService } from 'vs/platform/log/node/spdlogService';
|
||||
import { ILogService, LogLevel } from 'vs/platform/log/common/log';
|
||||
import { LogLevelSetterChannelClient, FollowerLogService } from 'vs/platform/log/node/logIpc';
|
||||
import { LocalizationsService } from 'vs/platform/localizations/node/localizations';
|
||||
@@ -47,7 +48,6 @@ import { StorageDataCleaner } from 'vs/code/electron-browser/sharedProcess/contr
|
||||
import { LogsDataCleaner } from 'vs/code/electron-browser/sharedProcess/contrib/logsDataCleaner';
|
||||
import { IMainProcessService } from 'vs/platform/ipc/electron-browser/mainProcessService';
|
||||
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { SpdLogService } from 'vs/platform/log/node/spdlogService';
|
||||
|
||||
export interface ISharedProcessConfiguration {
|
||||
readonly machineId: string;
|
||||
@@ -79,7 +79,7 @@ class MainProcessService implements IMainProcessService {
|
||||
}
|
||||
}
|
||||
|
||||
async function main(server: Server, initData: ISharedProcessInitData, configuration: ISharedProcessConfiguration): Promise<void> {
|
||||
function main(server: Server, initData: ISharedProcessInitData, configuration: ISharedProcessConfiguration): void {
|
||||
const services = new ServiceCollection();
|
||||
|
||||
const disposables: IDisposable[] = [];
|
||||
@@ -94,17 +94,14 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat
|
||||
|
||||
const mainRouter = new StaticRouter(ctx => ctx === 'main');
|
||||
const logLevelClient = new LogLevelSetterChannelClient(server.getChannel('loglevel', mainRouter));
|
||||
const logService = new FollowerLogService(logLevelClient, new SpdLogService('sharedprocess', environmentService.logsPath, initData.logLevel));
|
||||
const logService = new FollowerLogService(logLevelClient, createBufferSpdLogService('sharedprocess', initData.logLevel, environmentService.logsPath));
|
||||
disposables.push(logService);
|
||||
logService.info('main', JSON.stringify(configuration));
|
||||
|
||||
const configurationService = new ConfigurationService(environmentService.settingsResource.path);
|
||||
disposables.push(configurationService);
|
||||
await configurationService.initialize();
|
||||
logService.info('main', JSON.stringify(configuration));
|
||||
|
||||
services.set(IEnvironmentService, environmentService);
|
||||
services.set(ILogService, logService);
|
||||
services.set(IConfigurationService, configurationService);
|
||||
services.set(IConfigurationService, new SyncDescriptor(ConfigurationService, [environmentService.appSettingsPath]));
|
||||
services.set(IRequestService, new SyncDescriptor(RequestService));
|
||||
services.set(IDownloadService, new SyncDescriptor(DownloadService));
|
||||
|
||||
@@ -125,7 +122,7 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat
|
||||
const services = new ServiceCollection();
|
||||
const environmentService = accessor.get(IEnvironmentService);
|
||||
const { appRoot, extensionsPath, extensionDevelopmentLocationURI: extensionDevelopmentLocationURI, isBuilt, installSourcePath } = environmentService;
|
||||
const telemetryLogService = new FollowerLogService(logLevelClient, new SpdLogService('telemetry', environmentService.logsPath, initData.logLevel));
|
||||
const telemetryLogService = new FollowerLogService(logLevelClient, createBufferSpdLogService('telemetry', initData.logLevel, environmentService.logsPath));
|
||||
telemetryLogService.info('The below are logs for every telemetry event sent from VS Code once the log level is set to trace.');
|
||||
telemetryLogService.info('===========================================================');
|
||||
|
||||
@@ -168,12 +165,12 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat
|
||||
// update localizations cache
|
||||
(localizationsService as LocalizationsService).update();
|
||||
// cache clean ups
|
||||
disposables.push(combinedDisposable(
|
||||
disposables.push(combinedDisposable([
|
||||
instantiationService2.createInstance(NodeCachedDataCleaner),
|
||||
instantiationService2.createInstance(LanguagePackCachedDataCleaner),
|
||||
instantiationService2.createInstance(StorageDataCleaner),
|
||||
instantiationService2.createInstance(LogsDataCleaner)
|
||||
));
|
||||
]));
|
||||
disposables.push(extensionManagementService as ExtensionManagementService);
|
||||
});
|
||||
});
|
||||
@@ -221,6 +218,6 @@ async function handshake(configuration: ISharedProcessConfiguration): Promise<vo
|
||||
|
||||
const server = await setupIPC(data.sharedIPCHandle);
|
||||
|
||||
await main(server, data, configuration);
|
||||
main(server, data, configuration);
|
||||
ipcRenderer.send('handshake:im ready');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user