Anybody get colorized server logs working?
|
|
You know how when you run script/server on Windows, the output contains a lot of ANSI color escape sequences? On my Mac at work, Terminal seems to interpret those escape sequences correctly and certain lines get colored correctly. It really helps when I’m tailing a file to be able to scan it quickly. On Windows, I don’t know how to get this to work. I’ve installed the Win32Console gem, hoping that would would somehow magically work, but no dice. Is there something else I have to do to get it to work? Or am I wrong in thinking this could ever work on Windows? |
|
|
Try using the cygwin version of tail in a normal cmd window. |
|
|
Jeff, I battled with this for ages; after balking at the idea of installing a whole *nix stack (Cygwin) just for coloured logs! The built in log viewer in RadRails (Eclipse) supports coloured output. There is also a log tailer for Ruby.Netbeans – I’m currently bugging the author of TailFileLogger – Rogue <roguexz@gmail.com> – to add similar functionality. Perhaps you (all) could email Rogue and also ask for said functionality? Perhaps we could even set up a bounty -http://bountycounty.org/ – to reward him? D Below a copy of my email correspondance with Rogue on the issue sofar: Hi David, David Laing wrote: > Hi Roguexz, > > Thank you for your TailFileModule for Netbeans. I’m a Ruby on Rails > developer, using it on the Ruby version of Netbeans 6 RC1 (which rocks!) > > I wonder however, if I could trouble you to add one new feature: ASCII > colour highlighting. > > The default Rail’s Logs (sample attached) contain ASCII colour codes to > highlight different log lines in different colours. With *nix tail > these display fine; similarly the colours display well in Eclipse
I shall look at this and try and push the functionality. I was anyways intending on providing a few nice-2-have features, like restart tailing, etc. I shall see what I can do about the color codes, if you have any documentation that points to the ASCII color codes, I can use it right away. I shall add the context-menu option, and see if it is getting a little too cluttered or not. None the less will provide a system switch for it :-)
You are most welcome. later, Rogue |