An Anonymous Monk asked how to do something like this recently. Since there seems to be some demand for such a thing, and I was already working on it, here it is.

It prints:
A summary of errors and warnings, success and failure;
Projects with warnings, sorted most-warnings-first;
A list of successful projects;
A list of failed projects;
Every line that refers to "error" or "warning".

Many thanks to BrowserUK and many other monks for help with the GRT. Happy compiling...

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; } }

In reply to Useful information from Visual Studio compiler logs. by McMahon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.