A module that allows logging to multiple streams simultaneously.
Setup
const Console = require('console-extra').ConsoleAsync;
delete console;
console = await Console(process.stdout, process.stderr);
console = await Console(process.stdout, process.stderr, 'stream3.log');
console = await Console([ process.stdout, process.stderr, 'stream3.log', ... ]);
console = await Console({
output: process.stdout,
error: process.stderr
});
console = await Console({
output: [ process.stdout, process.stderr ],
error: 'file.txt'
});
This module extends the builtin Console
Use the non-async version only for already-opened and writable streams!