mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 07:04:52 +09:00
Add winston based logger for master, slave, ctl, lib, and web_ui code. Logging done from slaves and instances are sent to the master server and tagged with the instance and/or slave it originated from. This allows for example error messages to propagate back to the source that iniated the action. The master server also stores the log to allow it to be queried at a later point. For slaves a copy of the slave's log is also stored locally.
20 lines
545 B
JavaScript
20 lines
545 B
JavaScript
"use strict";
|
|
const assert = require("assert").strict;
|
|
|
|
const { testLines } = require("./factorio/lines");
|
|
const libLoggingUtils = require("@clusterio/lib/logging_utils");
|
|
|
|
|
|
describe("lib/logging_utils.js", function() {
|
|
describe("formatServerOutput", function() {
|
|
it("should pass the test lines", function() {
|
|
for (let [reference, output] of testLines) {
|
|
let line = libLoggingUtils._formatServerOutput(output);
|
|
// Strip colours
|
|
line = line.replace(/\x1B\[\d+m/g, "");
|
|
assert.deepEqual(line, reference);
|
|
}
|
|
});
|
|
});
|
|
});
|