Tuesday, 25 February 2014

Parsing a node.js log file in Windows (or anywhere with a browser!)

I'm getting to play with node at work and I love it! I love it a lot and can't think of anything finer TBH. But the log files are a bugger to read on windows. I'm guessing it's because they use lovely BASH escape characters in order to colour the text as it's getting spat out onto the terminal. I've taken to using forever to make sure my server keeps up and running while I'm developing but I still need to check the logs now and again. I can SSH into the AWS box where it is and copy the file across to my desktop but even Boxer hates the escape characters... Sublime Text doesn't mind them as much but it still isn't overly keen... so I thought I'd write this in order to parse the log files and spit them out as pre formatted html.