I want to log a warning, yellow message, with Grunt, when running a specific task.
Currently I use grunt.log.subhead
to output bold font, but it does no take to much attention.
grunt.log.subhead 'You may want to use --sourceMaps option'
You can try this:
grunt.log.writeln('You may want to use --sourceMaps option'['yellow'].bold);
The grunt API documentation for log does not mention how to do this. I found it in a set of slides here: http://slides.com/joshschumacher/grunt-logging#/
From the slides mentioned by @jon, valid colors are:
var colors = ['white', 'black', 'grey', 'blue', 'cyan', 'green', 'magenta', 'red', 'yellow', 'rainbow']; colors.forEach(function (color) { grunt.log.writeln('testing'[color]); grunt.log.writeln('testing bold'[color].bold); });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With