#!/usr/bin/perl

my $baseURI = "http://lxr.mozilla.org/seamonkey/source/";
my $file;
my $line;
my $level = 0;
my $msg;
my @styles = (
    "",
    "color:red;font-weight:bold;",
    "color:red;",
    "",
    "",
    "font-style:italic;"
    );
my $last_level = 0;
my $number = 0;

print "<html><head><title>flawfinder weblog 2002-05-06</title></head><body>\n";
print "<h1>flawfinder weblog 2002-05-06</h1>\n";
print "<p><a href='http://www.dwheeler.com/flawfinder'>flawfinder</a> homepage.</p>\n";
print "<!--<p><a href='flawfinder-mozilla.log'>flawfinder-mozilla.log</a></p>-->\n";
print "<ul>\n";
print "<li><a href='#l5'>Level 5</a></li>\n";
print "<li><a href='#l4'>Level 4</a></li>\n";
print "<li><a href='#l3'>Level 3</a></li>\n";
print "<li><a href='#l2'>Level 2</a></li>\n";
print "<li><a href='#l1'>Level 1</a></li>\n";
print "</ul>\n";

while (<>) {
    if (/^\.\/(\S+):(\S+)\s+\[(\S)\](.*)/) {
	$file = $1;
	$line = $2;
	$level = $3;
	$msg = $4;
	if ($level != $last_level) {
	    print "<a name='l$level' id='l$level'></a><h2>Level $level</h2>\n";
	    $last_level = $level;
	}
	$number++;
	print "<p style='$styles[$level]'>$number) <a href='$baseURI$file#$line'>$file:$line</a> [$level] $msg</p>\n";
    }
}

print "</body></html>";

