[build] update gulp debug logger
This commit is contained in:
@@ -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);
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user