Skip to content

Commit

Permalink
New: Track errors logged & only print them once
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Dec 21, 2017
1 parent 7440f6d commit 4287660
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/versioned/^4.0.0/log/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ var formatError = require('../formatError');
// Wire up logging events
function logEvents(gulpInst) {

var loggedErrors = [];

gulpInst.on('start', function(e) {
// TODO: batch these
// so when 5 tasks start at once it only logs one time with all 5
Expand All @@ -30,7 +32,12 @@ function logEvents(gulpInst) {
chalk.red('errored after'),
chalk.magenta(time)
);
log.error(msg);

// If we haven't logged this before, log it and add to list
if (loggedErrors.indexOf(e.error) === -1) {
log.error(msg);
loggedErrors.push(e.error);
}
});
}

Expand Down

0 comments on commit 4287660

Please sign in to comment.