Skip to content

Commit 50ec968

Browse files
committed
do not use arguments
1 parent e77bded commit 50ec968

1 file changed

Lines changed: 15 additions & 16 deletions

File tree

src/vs/platform/log/node/spdlogService.ts

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -86,47 +86,46 @@ export class SpdLogService extends AbstractLogService implements ILogService {
8686
}
8787
}
8888

89-
trace(): void {
89+
trace(message: string, ...args: any[]): void {
9090
if (this.getLevel() <= LogLevel.Trace) {
91-
this._log(LogLevel.Trace, this.format(arguments));
91+
this._log(LogLevel.Trace, this.format([message, ...args]));
9292
}
9393
}
9494

95-
debug(): void {
95+
debug(message: string, ...args: any[]): void {
9696
if (this.getLevel() <= LogLevel.Debug) {
97-
this._log(LogLevel.Debug, this.format(arguments));
97+
this._log(LogLevel.Debug, this.format([message, ...args]));
9898
}
9999
}
100100

101-
info(): void {
101+
info(message: string, ...args: any[]): void {
102102
if (this.getLevel() <= LogLevel.Info) {
103-
this._log(LogLevel.Info, this.format(arguments));
103+
this._log(LogLevel.Info, this.format([message, ...args]));
104104
}
105105
}
106106

107-
warn(): void {
107+
warn(message: string, ...args: any[]): void {
108108
if (this.getLevel() <= LogLevel.Warning) {
109-
this._log(LogLevel.Warning, this.format(arguments));
109+
this._log(LogLevel.Warning, this.format([message, ...args]));
110110
}
111111
}
112112

113-
error(): void {
113+
error(message: string | Error, ...args: any[]): void {
114114
if (this.getLevel() <= LogLevel.Error) {
115-
const arg = arguments[0];
116115

117-
if (arg instanceof Error) {
116+
if (message instanceof Error) {
118117
const array = Array.prototype.slice.call(arguments) as any[];
119-
array[0] = arg.stack;
118+
array[0] = message.stack;
120119
this._log(LogLevel.Error, this.format(array));
121120
} else {
122-
this._log(LogLevel.Error, this.format(arguments));
121+
this._log(LogLevel.Error, this.format([message, ...args]));
123122
}
124123
}
125124
}
126125

127-
critical(): void {
126+
critical(message: string | Error, ...args: any[]): void {
128127
if (this.getLevel() <= LogLevel.Critical) {
129-
this._log(LogLevel.Critical, this.format(arguments));
128+
this._log(LogLevel.Critical, this.format([message, ...args]));
130129
}
131130
}
132131

@@ -163,4 +162,4 @@ export class SpdLogService extends AbstractLogService implements ILogService {
163162

164163
return result;
165164
}
166-
}
165+
}

0 commit comments

Comments
 (0)