use warnings; use strict; my $msg; my $errors = 0; my $warnings =0; my $failures = 0; my $success = 0; my @goodProjects; my @badProjects; open (LOG, "log.log") or die "Could not open log file: $!\n"; open (OUT, ">logSummary.txt") or die "Could not open output file: $!\n"; my @msgs = <LOG>; foreach $msg(@msgs) { if ($msg =~ ": error") { $errors++; } if ($msg =~ ": warning") { $warnings++; } if (($msg =~ "error") and ($msg =~ "warning") and !($msg =~ "0 err +or")) { $failures++; push @badProjects, $msg; } if ($msg =~ "0 error") { $success++; push @goodProjects, $msg; } } #Guttman-Rosler Transform! my @sorted = map{ substr $_, 5; }sort { $b cmp $a } map{ m[,\s+(\d+)] ? sprintf '%05d%s', $1, $_ : () } @msgs; #End GRT print OUT "\nBuild had approximately $errors errors.\n"; print OUT "Build had approximately $warnings warnings.\n"; print OUT "$failures projects failed to build.\n"; print OUT "$success projects built successfully.\n\n"; print OUT "Projects sorted according to number of warnings:\n"; foreach my $warning(@sorted) { print OUT $warning unless ($warning =~ ", 0 warning"); } print OUT "\n\n"; print OUT "$success Successful projects:\n"; print OUT "@goodProjects"; print OUT "\n\n"; print OUT "$failures Failed projects:\n"; print OUT "@badProjects"; print OUT "\n\n"; print OUT "Detailed information about errors and warnings follows:\n\n +"; foreach $msg(@msgs) { if (($msg =~ "error") or ($msg =~ "warning")) { print OUT $msg; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Useful information from Visual Studio compiler logs.
by eyepopslikeamosquito (Archbishop) on May 27, 2004 at 13:59 UTC | |
by theorbtwo (Prior) on May 27, 2004 at 16:55 UTC | |
by McMahon (Chaplain) on May 27, 2004 at 14:47 UTC |