gruntjs/grunt — pull request #859 by netroy (2013-08-02 00:40:18+00:00)
Title: Emit progress events for a more decoupled logging.

I was trying to build a webapp that could trigger grunt & tracks the output via a websocket, until a realised that grunt's logger wasn't very pluggable, so I added events to `grunt.event`.

#### Quick hack to test this.
* disable grunt logger with `grunt.log.header = grunt.fail.report = function () {};`
* define a logger that listens to the events

```javascript
var write = process.stdout.write.bind(process.stdout);
grunt.event.on('grunt:start', function () {
console.log('Started\n----------'.white.bold);
});
grunt.event.on('grunt:done', function (warnCount) {
var label = 'with' + (warnCount > 0 ? ' '+ warnCount : 'out') + ' warnings';
console.log('----------\nDone!'.white.bold, label);
});
grunt.event.on('alias:start', function (name) {
console.log('\u21A0'.grey, name.grey);
});
grunt.event.on('multi:start', function (name) {
console.log('\u21A0'.green, name);
})
grunt.event.on('task:start', function (name, target) {
write(' \u21B3 '.green);
write(target);
});
grunt.event.on('task:done', function () {
console.log(' \u2713'.green);
});
grunt.event.on('task:fail', function () {
console.log(' \u2717'.red);
});
```

##### Screenshot
![output](https://f.cloud.github.com/assets/196144/898319/f0439726-fb0b-11e2-87f9-61628bb134da.png)