# Tool to color-highlight important phrases in log

When testing a mobile app (android in this case), I like to use the SDK to monitor the data traffic between app and server. This to easier detect defects and send the reports to the proper developer (system).

Currently I use Putty/Cygwin and use commando prompt: adb –s /deviceId\ logcat –s /special-phrace-to-filter-out-everything-else-butt–app-traffic\. This is all good and I can follow the data traffic between client and server.

Now to my problem: I would like the console to catch/recognize special phrases and give those phrases different color. Anyone know if there is a nice tool for this? (It doesn’t need to be Putty / CygWin).

-
Is there a fixed number of special phrases or do you need to match them with a regular expression? –  user246 Feb 4 '13 at 14:18
Would this question have more chances of getting a helpful response on Stackoverflow? –  Suchit Parikh Feb 4 '13 at 18:51
@user246 need to match them with a regular expression, most common is error codes from server –  Pierre Feb 6 '13 at 8:28

Take a look at http://www.vanheusden.com/multitail/

Should fit the bill for what you are looking for I haven't tried it on cygwin but I think there's a build for it

You can have multiple color scheme so when you call your script, just pass it the color scheme you want

It also support regex so you can easily highlight timestamps or ip address

As a bonus, it also does much more than color text :)

-
After testing and trying to get things to work, this seems to fit my needs the most. Big and many thanks! –  Pierre Feb 7 '13 at 7:38

If you only need a single color, you can use grep like this:

egrep --color "a regular expression|"


You might try snaketail-net. It runs in its own window rather than in a console, but it claims to highlight regular expressions in large log files.

Alternatively, you may be able to write a shell script that meets your needs. In bash, you can use the tput command to generate escape sequences for changing colors. See this page for details. You may need to experiment to determine whether the same instructions work with cygwin's shell. You can use something like the sed command to edit strings that match regular expressions.

-

The Configurable highlighting feature of BareTail works for us.

Using it with adb needs some tweaking, for example redirecting the output to a file that BareTail will show:

adb shell cat /proc/kmsg > file_to_show.txt

-