Skip to content

Commit 4287660

Browse files
committed
New: Track errors logged & only print them once
1 parent 7440f6d commit 4287660

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/versioned/^4.0.0/log/events.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ var formatError = require('../formatError');
88
// Wire up logging events
99
function logEvents(gulpInst) {
1010

11+
var loggedErrors = [];
12+
1113
gulpInst.on('start', function(e) {
1214
// TODO: batch these
1315
// so when 5 tasks start at once it only logs one time with all 5
@@ -30,7 +32,12 @@ function logEvents(gulpInst) {
3032
chalk.red('errored after'),
3133
chalk.magenta(time)
3234
);
33-
log.error(msg);
35+
36+
// If we haven't logged this before, log it and add to list
37+
if (loggedErrors.indexOf(e.error) === -1) {
38+
log.error(msg);
39+
loggedErrors.push(e.error);
40+
}
3441
});
3542
}
3643

0 commit comments

Comments
 (0)