Skip to content

Commit 8fb1d17

Browse files
committed
allow log service in cli process
1 parent ea7a6b8 commit 8fb1d17

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/vs/code/node/cliProcessMain.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ import { ChoiceCliService } from 'vs/platform/message/node/messageCli';
3535
import { getBaseLabel } from 'vs/base/common/labels';
3636
import { IStateService } from 'vs/platform/state/common/state';
3737
import { StateService } from 'vs/platform/state/node/stateService';
38+
import { SpdLogService } from 'vs/platform/log/node/spdlogService';
39+
import { registerGlobalLogService, ILogService } from 'vs/platform/log/common/log';
3840

3941
const notFound = (id: string) => localize('notFound', "Extension '{0}' not found.", id);
4042
const notInstalled = (id: string) => localize('notInstalled', "Extension '{0}' is not installed.", id);
@@ -175,7 +177,15 @@ const eventPrefix = 'monacoworkbench';
175177

176178
export function main(argv: ParsedArgs): TPromise<void> {
177179
const services = new ServiceCollection();
178-
services.set(IEnvironmentService, new SyncDescriptor(EnvironmentService, argv, process.execPath));
180+
181+
const environmentService = new EnvironmentService(argv, process.execPath);
182+
const logService = new SpdLogService('cli', environmentService);
183+
registerGlobalLogService(logService);
184+
185+
logService.info('main', argv);
186+
187+
services.set(IEnvironmentService, environmentService);
188+
services.set(ILogService, logService);
179189
services.set(IStateService, new SyncDescriptor(StateService));
180190

181191
const instantiationService: IInstantiationService = new InstantiationService(services);

0 commit comments

Comments
 (0)