[build] update gulp debug logger

This commit is contained in:
2017-12-20 17:53:58 +03:00
parent 69c2b735a0
commit 6345ddcd19
17 changed files with 212 additions and 77 deletions

View File

@@ -20,11 +20,17 @@ const log = (line) => {
module.exports = () => {
return through.obj(function (file, enc, callback) {
const debug = file.debug;
if (!file.debug) {
this.emit('end');
callback();
return;
}
const server = net.createServer((socket) => {
socket.on("data", (data) => {
const lines = data.toString().split('\n');
for (let line of lines) if (line.length > 2) {
log(line.substr(2));
log(line);
}
});
socket.on("close", () => {
@@ -34,7 +40,8 @@ module.exports = () => {
callback();
});
});
server.listen(5000);
gutil.log(col.green('[debug]'), col.cyan('listen on'), col.magenta(`${debug.host}:${debug.port}`));
server.listen(debug.port, debug.host);
})
};