The subject is nearly the whole story and there is no problem while working from within the command shell only. But it leads to missing logs when the console output is redirected to other processes, such as IDEs.
I have been stumbling over several comparable issues, e.g. nodejs/node-v0.x-archive#3871 and satyr/coco#168
Anyhow, the issue is that process.exit() will terminate node immediately, even if there are still queued writes to stdout. A workaround would be to simply remove this call where possible.
In case of grunt this would be /lib/grunt.js (line 135) for successfull builds. ;-)
I am not sure if this explicit exit is really neccessary. If it is there just to be on the safe side, maybe it could be removed (at least under Windows) to make integration into 3rd party tools more reliable.
I have tested it, it really works by commenting out the line mentioned above.
But I have no idea how to handle failed builds (/lib/grunt/fail.js, lines 42 and 73), since the call to process.exit is required for errorcodes there. Maybe there is some way to explicitly flush stdout and stderr before exiting, but I could not figure out how...
I'm pretty sure I fixed this in 0.4.0 devel with 7f3c26b. Can you try 0.4.0a and see if that fixes the problem?
The new util.exit has correct stdout flushing, thanks for the fast reply!
Hopefully v0.4.0 will be released soon. ;-)
@queequac i am having issues with regular node stdout flushing. what NEW util.exit where you talking about? Is this a util.exit in node.js or in grunt?
found it at https://github.com/gruntjs/grunt/blob/devel/lib/util/exit.js