Skip to content

Commit

Permalink
Used grunt.verbose to show detailed logging (#419) r=vladikoff
Browse files Browse the repository at this point in the history
Used grunt.verbose to show detailed logging only for verbose mode.

Added a note about quiet run

Fixed incorrect commit

Added the same for source maps

Fix for jsHint errors

Removed unused function

Removed newline
  • Loading branch information
The Half Blood Prince authored and vladikoff committed Jul 19, 2016
1 parent c3dae35 commit 0d2f331
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,8 @@ grunt.initConfig({
}
});
```
#### Quiet Mode
By default the task supresses the logging, use _--verbose_ to show the full output.


## Release History
Expand Down
19 changes: 2 additions & 17 deletions tasks/uglify.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,6 @@ function relativePath(file1, file2) {
return '';
}

function reportFacility( grunt, options ){
var reporter;
switch( options.report ){
case 'none':
reporter = grunt.verbose;
break;
default:
case 'min':
case 'gzip':
reporter = grunt.log;
}
return reporter;
}

// Converts \r\n to \n
function normalizeLf(string) {
return string.replace(/\r\n/g, '\n');
Expand All @@ -64,7 +50,6 @@ module.exports = function(grunt) {
screwIE8: false,
quoteStyle: 0
});
var log = reportFacility( grunt, options );

// Process banner.
var banner = normalizeLf(options.banner);
Expand Down Expand Up @@ -182,12 +167,12 @@ module.exports = function(grunt) {
// Write source map
if (options.sourceMap) {
grunt.file.write(options.generatedSourceMapName, result.sourceMap);
log.writeln('File ' + chalk.cyan(options.generatedSourceMapName) + ' created (source map).');
grunt.verbose.writeln('File ' + chalk.cyan(options.generatedSourceMapName) + ' created (source map).');
createdMaps++;
}

var outputSize = maxmin(result.max, output, options.report === 'gzip');
log.writeln('File ' + chalk.cyan(f.dest) + ' created: ' + outputSize);
grunt.verbose.writeln('File ' + chalk.cyan(f.dest) + ' created: ' + outputSize);

createdFiles++;
});
Expand Down

0 comments on commit 0d2f331

Please sign in to comment.