From 8fb1d172e1fca36d7e38cf10f5a86e52f03bd32d Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 4 Dec 2017 18:28:50 +0100 Subject: [PATCH] allow log service in cli process --- src/vs/code/node/cliProcessMain.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/vs/code/node/cliProcessMain.ts b/src/vs/code/node/cliProcessMain.ts index 51ccfcfc782..93f32694539 100644 --- a/src/vs/code/node/cliProcessMain.ts +++ b/src/vs/code/node/cliProcessMain.ts @@ -35,6 +35,8 @@ import { ChoiceCliService } from 'vs/platform/message/node/messageCli'; import { getBaseLabel } from 'vs/base/common/labels'; import { IStateService } from 'vs/platform/state/common/state'; import { StateService } from 'vs/platform/state/node/stateService'; +import { SpdLogService } from 'vs/platform/log/node/spdlogService'; +import { registerGlobalLogService, ILogService } from 'vs/platform/log/common/log'; const notFound = (id: string) => localize('notFound', "Extension '{0}' not found.", id); const notInstalled = (id: string) => localize('notInstalled', "Extension '{0}' is not installed.", id); @@ -175,7 +177,15 @@ const eventPrefix = 'monacoworkbench'; export function main(argv: ParsedArgs): TPromise { const services = new ServiceCollection(); - services.set(IEnvironmentService, new SyncDescriptor(EnvironmentService, argv, process.execPath)); + + const environmentService = new EnvironmentService(argv, process.execPath); + const logService = new SpdLogService('cli', environmentService); + registerGlobalLogService(logService); + + logService.info('main', argv); + + services.set(IEnvironmentService, environmentService); + services.set(ILogService, logService); services.set(IStateService, new SyncDescriptor(StateService)); const instantiationService: IInstantiationService = new InstantiationService(services); -- GitLab