Open ORESoftware opened 8 years ago
Try this solution contributed by @markstos:
gulp.task('run', ['default', 'watch'], function() {
var nodemon = require('gulp-nodemon'),
spawn = require('child_process').spawn,
bunyan
nodemon({
script: paths.server,
ext: 'js json',
ignore: [
'var/',
'node_modules/'
],
watch: [paths.etc, paths.src],
stdout: false,
readable: false
})
.on('readable', function() {
// free memory
bunyan && bunyan.kill()
bunyan = spawn('./node_modules/bunyan/bin/bunyan', [
'--output', 'short',
'--color'
])
bunyan.stdout.pipe(process.stdout)
bunyan.stderr.pipe(process.stderr)
this.stdout.pipe(bunyan.stdin)
this.stderr.pipe(bunyan.stdin)
});
})
But that is way too complicated. It would be nice to be able to do something like this:
nodemon().pipe(bunyan.stream)
EDIT: tagged 'enhancement'
ok thanks, yeah I have been struggling with it
I am a big fan of gulp-nodemon, but I cannot figure out how to pipe it through Bunyan
I have to do this:
but I would rather do something like this:
with " | bunyan -l debug -o short" as some sort of argument using this:
I am just being stoopid and not using the right command or is there something else wrong?