You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
338 B
JavaScript
19 lines
338 B
JavaScript
'use strict';
|
|
|
|
const split = require("split");
|
|
const streamCombiner = require("stream-combiner2");
|
|
const sink = require("through2-sink");
|
|
|
|
module.exports = function logStream(logger) {
|
|
return streamCombiner([
|
|
split(),
|
|
sink((chunk) => {
|
|
let line = chunk.toString();
|
|
|
|
if (line.trim() !== "") {
|
|
logger(line);
|
|
}
|
|
})
|
|
]);
|
|
}
|