From: alegrand Date: Thu, 27 Jan 2005 18:43:07 +0000 (+0000) Subject: It's just a crappy perl script. But it may help those who are unable to make paje... X-Git-Tag: v3.3~4560 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/058ad71842ebb98aeb28b42adb14b49031f997d6 It's just a crappy perl script. But it may help those who are unable to make paje work. Moreover... I still haven't written the MSG output for paje. :) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@790 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/tools/MSG_visualization/colorize.pl b/tools/MSG_visualization/colorize.pl new file mode 100755 index 0000000000..371f3f908b --- /dev/null +++ b/tools/MSG_visualization/colorize.pl @@ -0,0 +1,49 @@ +#!/usr/bin/perl + +$col_white = "\033[00m"; +$col_black = "\033[30m"; +$col_red = "\033[31m"; +$col_green = "\033[32m"; +$col_yellow = "\033[33m"; +$col_blue = "\033[34m"; +$col_purple = "\033[35m"; +$col_cyan = "\033[36m"; +$col_ltgray = "\033[37m"; +$col_darkgray = "\033[30m"; + +$col_norm = $col_white; +$col_background = "\033[07m"; +$col_brighten = "\033[01m"; +$col_underline = "\033[04m"; +$col_blink = "\033[05m"; + +# Customize colors here... +# +$col_default = $col_ltgray; +my (@coltab) = ( + $col_green, $col_yellow, + $col_purple, $col_cyan, + $col_red, $col_blue, + $col_background . $col_green, + $col_background . $col_yellow, $col_background . $col_purple, + $col_background . $col_cyan, $col_background . $col_red, + $col_background . $col_blue, $col_background . $col_magenta, +); + +while (<>) { + $orgline = $thisline = $_; + + if ( $thisline =~ /^\[[0-9\.]*\] P[0-9]* \|/ ) { + ( $number, $message ) = split ( / \| /, $thisline ); + chomp $message; + $head = $number; + $number =~ s/^\[[0-9\.]*\] P//; + $number =~ s/^ .*$//; + $head =~ s/^(\[.*\]) (.*)$/$col_norm$1 $coltab[($number-1) % scalar(@coltab)]$2/; + print $head. " " . $message . $col_norm . "\n"; + next; + } + print $col_default. $orgline; +} + +print $col_norm;