Skip to content

Commit 1b54baf

Browse files
committed
💄
1 parent 6bfe9bb commit 1b54baf

4 files changed

Lines changed: 22 additions & 25 deletions

File tree

src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ import { ipcRenderer } from 'electron';
3838
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
3939
import { createSharedProcessContributions } from 'vs/code/electron-browser/sharedProcess/contrib/contributions';
4040
import { createSpdLogService } from 'vs/platform/log/node/spdlogService';
41-
import { ILogService, FollowerLogService, LogLevel } from 'vs/platform/log/common/log';
42-
import { LogLevelSetterChannelClient } from 'vs/platform/log/common/logIpc';
41+
import { ILogService, LogLevel } from 'vs/platform/log/common/log';
42+
import { LogLevelSetterChannelClient, FollowerLogService } from 'vs/platform/log/common/logIpc';
4343

4444
export interface ISharedProcessConfiguration {
4545
readonly machineId: string;

src/vs/platform/log/common/log.ts

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,12 @@ export enum LogLevel {
2323
Off
2424
}
2525

26-
export interface ILogLevelSetter {
27-
onDidChangeLogLevel: Event<LogLevel>;
28-
setLevel(level: LogLevel): void;
29-
}
30-
31-
export interface ILogService extends ILogLevelSetter, IDisposable {
26+
export interface ILogService extends IDisposable {
3227
_serviceBrand: any;
28+
onDidChangeLogLevel: Event<LogLevel>;
3329

3430
getLevel(): LogLevel;
31+
setLevel(level: LogLevel): void;
3532
trace(message: string, ...args: any[]): void;
3633
debug(message: string, ...args: any[]): void;
3734
info(message: string, ...args: any[]): void;
@@ -290,19 +287,6 @@ export class DelegatedLogService extends Disposable implements ILogService {
290287
}
291288
}
292289

293-
export class FollowerLogService extends DelegatedLogService implements ILogService {
294-
_serviceBrand: any;
295-
296-
constructor(private master: ILogLevelSetter, logService: ILogService) {
297-
super(logService);
298-
this._register(master.onDidChangeLogLevel(level => logService.setLevel(level)));
299-
}
300-
301-
setLevel(level: LogLevel): void {
302-
this.master.setLevel(level);
303-
}
304-
}
305-
306290
export class NullLogService implements ILogService {
307291
_serviceBrand: any;
308292
readonly onDidChangeLogLevel: Event<LogLevel> = new Emitter<LogLevel>().event;

src/vs/platform/log/common/logIpc.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import { IChannel, eventToCall, eventFromCall } from 'vs/base/parts/ipc/common/ipc';
77
import { TPromise } from 'vs/base/common/winjs.base';
8-
import { LogLevel, ILogService, ILogLevelSetter } from 'vs/platform/log/common/log';
8+
import { LogLevel, ILogService, DelegatedLogService } from 'vs/platform/log/common/log';
99
import Event, { buffer } from 'vs/base/common/event';
1010

1111
export interface ILogLevelSetterChannel extends IChannel {
@@ -30,7 +30,7 @@ export class LogLevelSetterChannel implements ILogLevelSetterChannel {
3030
}
3131
}
3232

33-
export class LogLevelSetterChannelClient implements ILogLevelSetter {
33+
export class LogLevelSetterChannelClient {
3434

3535
constructor(private channel: ILogLevelSetterChannel) { }
3636

@@ -40,4 +40,17 @@ export class LogLevelSetterChannelClient implements ILogLevelSetter {
4040
setLevel(level: LogLevel): TPromise<void> {
4141
return this.channel.call('setLevel', level);
4242
}
43+
}
44+
45+
export class FollowerLogService extends DelegatedLogService implements ILogService {
46+
_serviceBrand: any;
47+
48+
constructor(private master: LogLevelSetterChannelClient, logService: ILogService) {
49+
super(logService);
50+
this._register(master.onDidChangeLogLevel(level => logService.setLevel(level)));
51+
}
52+
53+
setLevel(level: LogLevel): void {
54+
this.master.setLevel(level);
55+
}
4356
}

src/vs/workbench/electron-browser/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
4343
import { createSpdLogService } from 'vs/platform/log/node/spdlogService';
4444

4545
import fs = require('fs');
46-
import { ConsoleLogService, MultiplexLogService, ILogService, FollowerLogService } from 'vs/platform/log/common/log';
46+
import { ConsoleLogService, MultiplexLogService, ILogService } from 'vs/platform/log/common/log';
4747
import { IssueChannelClient } from 'vs/platform/issue/common/issueIpc';
4848
import { IIssueService } from 'vs/platform/issue/common/issue';
49-
import { LogLevelSetterChannelClient } from 'vs/platform/log/common/logIpc';
49+
import { LogLevelSetterChannelClient, FollowerLogService } from 'vs/platform/log/common/logIpc';
5050
gracefulFs.gracefulify(fs); // enable gracefulFs
5151

5252
export function startup(configuration: IWindowConfiguration): TPromise<void> {

0 commit comments

Comments
 (0)