node-supervisor
node-supervisor copied to clipboard
Unable to pipe output to something else
Hello there
I'd like to pipe the output with a tool util like https://github.com/pwmckenna/grunt-bunyan with a command like this:
node server.js | ./node_modules/bunyan/bin/bunyan
so that bunyan's log is pretty printed. Looks like this is not supported, so, sorry to ask but I think we need a new parameter pipeTo
here to make this work.
I also tried to fix this in my gulp file but no success. Something like:
gulp.task('supervisor', function() {
supervisor(..., {
extensions: ['js', 'json'],
}).pipe(exec(' | ./node_modules/bunyan/bin/bunyan'));
});
wont work.
Another solution would be a new parameter to pipe out the output. Just a stream we can redirect to anywhere, i.E. to another gulp plugin.
Okay, I think I see what you mean. Supervisor's own output gets piped, but the output of the child process doesn't. Is that what you're seeing too?
@iangreenleaf Right man, that's the issue here
Workaround: Just output log to some file for example app.error.json then use command:
tail -f -n100 ./app.error.json | bunyan