Skip to content

Commit 0d618bb

Browse files
committed
Use spdlog for log service
1 parent a0121f2 commit 0d618bb

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

channel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export class ExtensionEnvironmentChannel implements IServerChannel {
161161
throw new Error(`Invalid listen "${event}"`);
162162
}
163163

164-
public call(_: unknown, command: string, args?: any): Promise<any> {
164+
public call(_: unknown, command: string, _args?: any): Promise<any> {
165165
switch (command) {
166166
case "getEnvironmentData": return this.getEnvironmentData();
167167
case "getDiagnosticInfo": return this.getDiagnosticInfo();

server.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ import { parseMainProcessArgv } from "vs/platform/environment/node/argvHelper";
1616
import { ParsedArgs } from "vs/platform/environment/common/environment";
1717
import { EnvironmentService } from "vs/platform/environment/node/environmentService";
1818
import { InstantiationService } from "vs/platform/instantiation/common/instantiationService";
19-
import { ConsoleLogMainService } from "vs/platform/log/common/log";
19+
import { getLogLevel } from "vs/platform/log/common/log";
2020
import { LogLevelSetterChannel } from "vs/platform/log/common/logIpc";
21+
import { SpdLogService } from "vs/platform/log/node/spdlogService";
2122
import { IProductConfiguration } from "vs/platform/product/common/product";
2223
import { ConnectionType } from "vs/platform/remote/common/remoteAgentConnection";
2324
import { REMOTE_FILE_SYSTEM_CHANNEL_NAME } from "vs/platform/remote/common/remoteAgentFileSystemChannel";
25+
import { RemoteExtensionLogFileName } from "vs/workbench/services/remote/common/remoteAgentService";
2426
import { IWorkbenchConstructionOptions } from "vs/workbench/workbench.web.api";
2527

2628
import { Connection, Server as IServer } from "vs/server/connection";
@@ -112,8 +114,11 @@ export class Server implements IServer {
112114

113115
this.environmentService = new EnvironmentService(args, process.execPath);
114116

115-
// TODO: might want to use spdlog.
116-
const logService = new ConsoleLogMainService();
117+
const logService = new SpdLogService(
118+
RemoteExtensionLogFileName,
119+
this.environmentService.logsPath,
120+
getLogLevel(this.environmentService),
121+
);
117122
this.ipc.registerChannel("loglevel", new LogLevelSetterChannel(logService));
118123

119124
const instantiationService = new InstantiationService();

0 commit comments

Comments
 (0)