Anybody get colorized server logs working?

Subscribe to Anybody get colorized server logs working? 3 posts, 3 voices

 
Avatar Jeff Cohen 89 posts

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?

 
Avatar Stu Holden 1 post

Try using the cygwin version of tail in a normal cmd window.

 
Avatar David Laing 2 posts

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

RadRails ( www.radrails.org <http://www.radrails.org>) tail command.

However in TailFileModule, as with other windows based tail utils (BareTail, mtail etc) the ASCII colors are not shown.

Do you think you would be able to add ASCII colours to TailFileModule?

A “Tail selected file” option on *.log file’s context menu would also be a neat addition.

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 :-)

Thanks for a great plugin!

You are most welcome.

later, Rogue