Skip to content

Commit 26bd63e

Browse files
committed
fastboot: Simplify logging code
This change avoids the `unicorn/prefer-prototype-methods` rule from triggering, and generally makes the code a bit more readable.
1 parent ea8a1a1 commit 26bd63e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

fastboot.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,18 @@ class LoggerWithoutTimestamp {
1212
constructor() {
1313
this.prefix = cluster.isMaster ? 'master' : 'worker';
1414
}
15-
writeLine() {
16-
this._write('info', Array.prototype.slice.apply(arguments));
15+
16+
writeLine(...args) {
17+
this._write('info', args);
1718
}
1819

19-
writeError() {
20-
this._write('error', Array.prototype.slice.apply(arguments));
20+
writeError(...args) {
21+
this._write('error', args);
2122
}
2223

2324
_write(level, args) {
2425
args[0] = `[${level}][${this.prefix}] ${args[0]}`;
25-
console.log.apply(console, args);
26+
console.log(...args);
2627
}
2728
}
2829

0 commit comments

Comments
 (0)