gulp-multi-process
gulp-multi-process copied to clipboard
Question: How does it handle output?
Hi!
One of the things I need to do is run webpack and watch for file changes, another I need to do is fire up dynamodb local, another one is to keep an electron app running... all of these spit out debugging information that I may need.
Ideally, I would use your plugin and combine all their output in one single stdout that I can prefix with an identifier:
[electron] debug from the app... [webpack] reloaded stuff [dynamodb] requested record X
is this something I can do with your plugin? (and if so, how?)
Thanks for your hard work!
Hi!, sorry but currently you can't do it but maybe is possible to add the feature. I'm going to try these days to see if it's possible.
Thanks @juanfran ! and again, thanks for all your work
Hi! I haven't got an easy & clean solution to do this (yet¿), but I have an idea without changing this plugin.
function hook_stdout(message) {
var old_write = process.stdout.write
process.stdout.write = (function(write) {
return function(string, encoding, fd) {
arguments[0] = message + ': ' + arguments[0];
write.apply(process.stdout, arguments);
}
})(process.stdout.write)
return function() {
process.stdout.write = old_write
}
}
gulp.task('task1', function(cb) {
hook_stdout('task example');
// example gulp task
});
with this anything inside the task1 will log this "task example: example text from webpack plugin", this is what you need?