node package manager


captures logs from any other gulp plugin in the pipe

Log Capture Plugin for Gulp

capture logs from any other gulp plugin in the pipe.

npm install gulp-log-capture --save-dev

capturing the call to console.log from jshint to create a XML report:

logCapture = require('gulp-log-capture');
gulp.task('lint-reports', function() {
    return gulp.src('src/js/*.js')
    .pipe(logCapture.start(console, 'log'))

To catch every call to console.log use logCapture.start(console, 'log') can be also used to track any other logging / writing function as long as it can be handled by nodejs util.format e.g. process.stdout.write can be captured via logCapture.start(process.stdout, 'write').

stops the capturing and pushes the log files through the pipe with the given file extension. The log file name pattern is <original filename>-<filename calling obj.fnName>-<fnName>.<fileExtension> e.g. foo.js-crazy_log_plugin-log.xml