Skip to content

Commit 3755995

Browse files
committed
fix(lib/vscode): patch setLevel in logIpc.ts
This patches LoggerChannel's call method by adding a private method called `setLevel`. We're not sure if this is an issue upstream but we patched it for now with this commit.
1 parent 883354a commit 3755995

File tree

1 file changed

+12
-0
lines changed
  • lib/vscode/src/vs/platform/log/common

1 file changed

+12
-0
lines changed

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

+12
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export class LoggerChannel implements IServerChannel {
6767
case 'createLogger': this.createLogger(URI.revive(arg[0]), arg[1]); return;
6868
case 'log': return this.log(URI.revive(arg[0]), arg[1]);
6969
case 'consoleLog': return this.consoleLog(arg[0], arg[1]);
70+
case 'setLevel': return this.setLevel(arg[0], this.loggers);
7071
}
7172

7273
throw new Error(`Call not found: ${command}`);
@@ -76,6 +77,17 @@ export class LoggerChannel implements IServerChannel {
7677
this.loggers.set(file.toString(), this.loggerService.createLogger(file, options));
7778
}
7879

80+
/*
81+
NOTE@coder: add this `setLevel` method ourselves.
82+
83+
We believe this could be an upstream bug but not sure.
84+
Patching it this way for now.
85+
3/15/21 jsjoeio
86+
*/
87+
private setLevel(level: LogLevel, loggers: Map<string, ILogger>): void {
88+
loggers.forEach(logger => logger.setLevel(level))
89+
}
90+
7991
private consoleLog(level: LogLevel, args: any[]): void {
8092
let consoleFn = console.log;
8193

0 commit comments

Comments
 (0)