提交 90b94baa 编写于 作者: J Joao Moreno

use logservice in shell

上级 672b0b73
......@@ -20,26 +20,26 @@ export class SpdLogService implements ILogService {
}
trace(message: string, ...args: any[]): void {
throw new Error('Method not implemented.');
// throw new Error('Method not implemented.');
}
debug(message: string, ...args: any[]): void {
throw new Error('Method not implemented.');
// throw new Error('Method not implemented.');
}
info(message: string, ...args: any[]): void {
throw new Error('Method not implemented.');
// throw new Error('Method not implemented.');
}
warn(message: string, ...args: any[]): void {
throw new Error('Method not implemented.');
// throw new Error('Method not implemented.');
}
error(message: string | Error, ...args: any[]): void {
throw new Error('Method not implemented.');
// throw new Error('Method not implemented.');
}
critical(message: string, ...args: any[]): void {
throw new Error('Method not implemented.');
// throw new Error('Method not implemented.');
}
}
\ No newline at end of file
......@@ -41,6 +41,7 @@ import { WorkspacesChannelClient } from 'vs/platform/workspaces/common/workspace
import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
import fs = require('fs');
import { SpdLogService } from 'vs/platform/log/node/spdlogService';
gracefulFs.gracefulify(fs); // enable gracefulFs
const currentWindowId = remote.getCurrentWindow().id;
......@@ -72,6 +73,8 @@ function openWorkbench(configuration: IWindowConfiguration): TPromise<void> {
const mainServices = createMainProcessServices(mainProcessClient);
const environmentService = new EnvironmentService(configuration, configuration.execPath);
const logService = new SpdLogService('renderer', environmentService);
logService.info('openWorkbench', JSON.stringify(configuration, null, 2));
// Since the configuration service is one of the core services that is used in so many places, we initialize it
// right before startup of the workbench shell to have its data ready for consumers
......@@ -90,6 +93,7 @@ function openWorkbench(configuration: IWindowConfiguration): TPromise<void> {
contextService: workspaceService,
configurationService: workspaceService,
environmentService,
logService,
timerService,
storageService
}, mainServices, configuration);
......
......@@ -88,6 +88,7 @@ import { ITextMateService } from 'vs/workbench/services/textMate/electron-browse
import { IBroadcastService, BroadcastService } from 'vs/platform/broadcast/electron-browser/broadcastService';
import { HashService } from 'vs/workbench/services/hash/node/hashService';
import { IHashService } from 'vs/workbench/services/hash/common/hashService';
import { ILogService } from 'vs/platform/log/common/log';
/**
* Services that we require for the Shell
......@@ -96,6 +97,7 @@ export interface ICoreServices {
contextService: IWorkspaceContextService;
configurationService: IConfigurationService;
environmentService: IEnvironmentService;
logService: ILogService;
timerService: ITimerService;
storageService: IStorageService;
}
......@@ -110,6 +112,7 @@ export class WorkbenchShell {
private storageService: IStorageService;
private messageService: MessageService;
private environmentService: IEnvironmentService;
private logService: ILogService;
private contextViewService: ContextViewService;
private configurationService: IConfigurationService;
private contextService: IWorkspaceContextService;
......@@ -140,6 +143,7 @@ export class WorkbenchShell {
this.contextService = coreServices.contextService;
this.configurationService = coreServices.configurationService;
this.environmentService = coreServices.environmentService;
this.logService = coreServices.logService;
this.timerService = coreServices.timerService;
this.storageService = coreServices.storageService;
......@@ -279,6 +283,7 @@ export class WorkbenchShell {
serviceCollection.set(IWorkspaceContextService, this.contextService);
serviceCollection.set(IConfigurationService, this.configurationService);
serviceCollection.set(IEnvironmentService, this.environmentService);
serviceCollection.set(ILogService, this.logService);
serviceCollection.set(ITimerService, this.timerService);
serviceCollection.set(IStorageService, this.storageService);
this.mainProcessServices.forEach((serviceIdentifier, serviceInstance) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册