In my Gruntfile, how can I add log statements, to its processing, as in the following example?
karma: {
unit: {
configFile: "<%= grunt.option('Debug') ? 'build/karma.conf.js' : '' %>",
console.log(configFile),
singleRun: true,
browsers: ['PhantomJS']
},
}
Gruntfiles are javascript so you can use console.log()
where ever as long as it is valid javascript.
grunt.initConfig({
karma: {
unit: {
configFile: 'build/karma.conf.js'
}
}
});
if (grunt.option('debug')) {
console.log(grunt.config('karma.unit.configFile'));
}
I'm not what you are asking, but if you want to place debug logging in a Gruntfile.js, have you seen the grunt.log method?
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