diff --git a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts index 335f01d17fe..f13a6d2c95f 100644 --- a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts +++ b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts @@ -38,8 +38,8 @@ import { ipcRenderer } from 'electron'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { createSharedProcessContributions } from 'vs/code/electron-browser/sharedProcess/contrib/contributions'; import { createSpdLogService } from 'vs/platform/log/node/spdlogService'; -import { ILogService, FollowerLogService, LogLevel } from 'vs/platform/log/common/log'; -import { LogLevelSetterChannelClient } from 'vs/platform/log/common/logIpc'; +import { ILogService, LogLevel } from 'vs/platform/log/common/log'; +import { LogLevelSetterChannelClient, FollowerLogService } from 'vs/platform/log/common/logIpc'; export interface ISharedProcessConfiguration { readonly machineId: string; diff --git a/src/vs/platform/log/common/log.ts b/src/vs/platform/log/common/log.ts index 5617bff5eb3..09d85742184 100644 --- a/src/vs/platform/log/common/log.ts +++ b/src/vs/platform/log/common/log.ts @@ -23,15 +23,12 @@ export enum LogLevel { Off } -export interface ILogLevelSetter { - onDidChangeLogLevel: Event; - setLevel(level: LogLevel): void; -} - -export interface ILogService extends ILogLevelSetter, IDisposable { +export interface ILogService extends IDisposable { _serviceBrand: any; + onDidChangeLogLevel: Event; getLevel(): LogLevel; + setLevel(level: LogLevel): void; trace(message: string, ...args: any[]): void; debug(message: string, ...args: any[]): void; info(message: string, ...args: any[]): void; @@ -290,19 +287,6 @@ export class DelegatedLogService extends Disposable implements ILogService { } } -export class FollowerLogService extends DelegatedLogService implements ILogService { - _serviceBrand: any; - - constructor(private master: ILogLevelSetter, logService: ILogService) { - super(logService); - this._register(master.onDidChangeLogLevel(level => logService.setLevel(level))); - } - - setLevel(level: LogLevel): void { - this.master.setLevel(level); - } -} - export class NullLogService implements ILogService { _serviceBrand: any; readonly onDidChangeLogLevel: Event = new Emitter().event; diff --git a/src/vs/platform/log/common/logIpc.ts b/src/vs/platform/log/common/logIpc.ts index e8c10a8416d..b792dc83329 100644 --- a/src/vs/platform/log/common/logIpc.ts +++ b/src/vs/platform/log/common/logIpc.ts @@ -5,7 +5,7 @@ import { IChannel, eventToCall, eventFromCall } from 'vs/base/parts/ipc/common/ipc'; import { TPromise } from 'vs/base/common/winjs.base'; -import { LogLevel, ILogService, ILogLevelSetter } from 'vs/platform/log/common/log'; +import { LogLevel, ILogService, DelegatedLogService } from 'vs/platform/log/common/log'; import Event, { buffer } from 'vs/base/common/event'; export interface ILogLevelSetterChannel extends IChannel { @@ -30,7 +30,7 @@ export class LogLevelSetterChannel implements ILogLevelSetterChannel { } } -export class LogLevelSetterChannelClient implements ILogLevelSetter { +export class LogLevelSetterChannelClient { constructor(private channel: ILogLevelSetterChannel) { } @@ -40,4 +40,17 @@ export class LogLevelSetterChannelClient implements ILogLevelSetter { setLevel(level: LogLevel): TPromise { return this.channel.call('setLevel', level); } +} + +export class FollowerLogService extends DelegatedLogService implements ILogService { + _serviceBrand: any; + + constructor(private master: LogLevelSetterChannelClient, logService: ILogService) { + super(logService); + this._register(master.onDidChangeLogLevel(level => logService.setLevel(level))); + } + + setLevel(level: LogLevel): void { + this.master.setLevel(level); + } } \ No newline at end of file diff --git a/src/vs/workbench/electron-browser/main.ts b/src/vs/workbench/electron-browser/main.ts index 50deed29769..6c93107c6cc 100644 --- a/src/vs/workbench/electron-browser/main.ts +++ b/src/vs/workbench/electron-browser/main.ts @@ -43,10 +43,10 @@ import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces'; import { createSpdLogService } from 'vs/platform/log/node/spdlogService'; import fs = require('fs'); -import { ConsoleLogService, MultiplexLogService, ILogService, FollowerLogService } from 'vs/platform/log/common/log'; +import { ConsoleLogService, MultiplexLogService, ILogService } from 'vs/platform/log/common/log'; import { IssueChannelClient } from 'vs/platform/issue/common/issueIpc'; import { IIssueService } from 'vs/platform/issue/common/issue'; -import { LogLevelSetterChannelClient } from 'vs/platform/log/common/logIpc'; +import { LogLevelSetterChannelClient, FollowerLogService } from 'vs/platform/log/common/logIpc'; gracefulFs.gracefulify(fs); // enable gracefulFs export function startup(configuration: IWindowConfiguration): TPromise {