Use spdlog for log service

This commit is contained in:
Asher 2019-07-01 14:18:30 -05:00
parent a0121f2f0c
commit 0d618bb1ef
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
2 changed files with 9 additions and 4 deletions

View File

@ -161,7 +161,7 @@ export class ExtensionEnvironmentChannel implements IServerChannel {
throw new Error(`Invalid listen "${event}"`);
}
public call(_: unknown, command: string, args?: any): Promise<any> {
public call(_: unknown, command: string, _args?: any): Promise<any> {
switch (command) {
case "getEnvironmentData": return this.getEnvironmentData();
case "getDiagnosticInfo": return this.getDiagnosticInfo();

View File

@ -16,11 +16,13 @@ import { parseMainProcessArgv } from "vs/platform/environment/node/argvHelper";
import { ParsedArgs } from "vs/platform/environment/common/environment";
import { EnvironmentService } from "vs/platform/environment/node/environmentService";
import { InstantiationService } from "vs/platform/instantiation/common/instantiationService";
import { ConsoleLogMainService } from "vs/platform/log/common/log";
import { getLogLevel } from "vs/platform/log/common/log";
import { LogLevelSetterChannel } from "vs/platform/log/common/logIpc";
import { SpdLogService } from "vs/platform/log/node/spdlogService";
import { IProductConfiguration } from "vs/platform/product/common/product";
import { ConnectionType } from "vs/platform/remote/common/remoteAgentConnection";
import { REMOTE_FILE_SYSTEM_CHANNEL_NAME } from "vs/platform/remote/common/remoteAgentFileSystemChannel";
import { RemoteExtensionLogFileName } from "vs/workbench/services/remote/common/remoteAgentService";
import { IWorkbenchConstructionOptions } from "vs/workbench/workbench.web.api";
import { Connection, Server as IServer } from "vs/server/connection";
@ -112,8 +114,11 @@ export class Server implements IServer {
this.environmentService = new EnvironmentService(args, process.execPath);
// TODO: might want to use spdlog.
const logService = new ConsoleLogMainService();
const logService = new SpdLogService(
RemoteExtensionLogFileName,
this.environmentService.logsPath,
getLogLevel(this.environmentService),
);
this.ipc.registerChannel("loglevel", new LogLevelSetterChannel(logService));
const instantiationService = new InstantiationService();