mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 23:04:52 +09:00
Without a transport Winston will print annoying "Attempt to write logs with no transports" warnings all over the place. Setup a transport in tests that cause logging to suppress this.
16 lines
449 B
JavaScript
16 lines
449 B
JavaScript
import { ConsoleTransport, TerminalFormat, logger } from "@clusterio/lib";
|
|
|
|
// Some integration tests may cause log events, import this file for such tests
|
|
// to avoid getting the "Attempt to write logs with no transports" warning when
|
|
// running tests individually.
|
|
|
|
before(function() {
|
|
const silent = process.env.SILENT_TEST;
|
|
|
|
logger.add(new ConsoleTransport({
|
|
level: "info",
|
|
format: new TerminalFormat(),
|
|
filter: () => !silent,
|
|
}));
|
|
});
|