mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-21 16:13:12 +09:00
Filter out instance logs from slave console
Exclude instance related logs from the slave console as these are not significant for the running of the slave and just add noise.
This commit is contained in:
1 parent
bfe523ac45
commit
59eca88e91
2 files changed
+8
-2
No files matched your search
@@ -32,9 +32,14 @@ class ConsoleTransport extends Transport {
|
||||
super(options);
|
||||
this.errorLevels = new Set(options.errorLevels || ["fatal", "error"]);
|
||||
this.warnLevels = new Set(options.warnLevels || ["warn"]);
|
||||
this.filter = options.filter || (() => true);
|
||||
}
|
||||
|
||||
log(info, callback) {
|
||||
if (!this.filter(info)) {
|
||||
return callback();
|
||||
}
|
||||
|
||||
/* eslint-disable no-console */
|
||||
if (this.errorLevels.has(info[LEVEL])) {
|
||||
console.error(info[MESSAGE]);
|
||||
@@ -44,7 +49,7 @@ class ConsoleTransport extends Transport {
|
||||
console.log(info[MESSAGE]);
|
||||
}
|
||||
/* eslint-enable no-console */
|
||||
callback();
|
||||
return callback();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user