Skip to content

Commit

Permalink
move branches to debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Dec 1, 2015
1 parent 5e121b6 commit c24b919
Showing 1 changed file with 32 additions and 11 deletions.
43 changes: 32 additions & 11 deletions lib/versioned/^4.0.0/log/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,47 @@ function logEvents(gulpInst) {
gulpInst.on('start', function(e) {
// TODO: batch these
// so when 5 tasks start at once it only logs one time with all 5
log.info('Starting', '\'' + chalk.cyan(e.name) + '\'...');
if (e.branch) {
log.debug('Starting', '\'' + chalk.underline(e.name) + '\'...');
} else {
log.info('Starting', '\'' + chalk.cyan(e.name) + '\'...');
}
});

gulpInst.on('stop', function(e) {
var time = prettyTime(e.duration);
log.info(
'Finished', '\'' + chalk.cyan(e.name) + '\'',
'after', chalk.magenta(time)
);
if (e.branch) {
log.debug(
'Finished', '\'' + chalk.underline(e.name) + '\'',
'after', chalk.magenta(time)
);
} else {
log.info(
'Finished', '\'' + chalk.cyan(e.name) + '\'',
'after', chalk.magenta(time)
);
}
});

gulpInst.on('error', function(e) {
var msg = formatError(e);
var time = prettyTime(e.duration);
log.error(
'\'' + chalk.cyan(e.name) + '\'',
chalk.red('errored after'),
chalk.magenta(time)
);
log.error(msg);

if (e.branch) {
log.debug(
'\'' + chalk.cyan(e.name) + '\'',
chalk.red('errored after'),
chalk.magenta(time)
);
log.debug(msg);
} else {
log.error(
'\'' + chalk.cyan(e.name) + '\'',
chalk.red('errored after'),
chalk.magenta(time)
);
log.error(msg);
}
});
}

Expand Down

0 comments on commit c24b919

Please sign in to comment.