#!/usr/bin/perl -w

=head1 NAME
    
    format-profile-log - красивой форматировние profile.log директовского формата

=cut

use strict;
use Term::ANSIColor;

while(<>) {
    chomp;
    my ($date, $time, $cmd, $reqid, $totals, $funcs) = split /\t/, $_, 6;
    $totals =~ s/,/ /g;
    $totals =~ s/(total:)(\S+)/$1.colored(["red"],$2)/ge;
    print "$date $time\t$cmd\t$reqid\t$totals\n";
    for my $f (split /\t/, $funcs) {
        print "\t$f\n";
    }
}
