pure/tasks/suppress.js

22 lines
534 B
JavaScript
Raw Normal View History

2013-11-18 19:45:37 +00:00
'use strict';
module.exports = function (grunt) {
grunt.registerTask('suppress', 'Suppresses noisy logs', function () {
var allowed = ['success', 'fail', 'warn', 'error'];
grunt.util.hooker.hook(grunt.log, {
passName: true,
pre: function (name) {
if (allowed.indexOf(name) === -1) {
grunt.log.muted = true;
}
},
post: function () {
grunt.log.muted = false;
}
});
});
};