Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node.js / Grunt export log to file

Is there any way of exporting the console log of your Grunt build to a *.txt file? I can run grunt in console with the >> thingy to export to file, like so:

grunt >> log.txt

But it does not log to console, only to file. And I'd like a module/task to do it for me after the build has finished.

like image 273
pioSko Avatar asked Feb 12 '23 13:02

pioSko


1 Answers

This is not actually grunt or node.js question. You need to use piping to tee.

grunt | tee log.txt

Or if you're using windows cmd:

grunt > log.txt | type log.txt
like image 154
raidendev Avatar answered Feb 15 '23 12:02

raidendev