paulodiovani paulodiovani - 2 months ago 18
Node.js Question

How to log colored messages with grunt.log

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'

Answer

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#/

Comments