Skip to content

Commit

Permalink
Now just shows number of warnings, rather than line numbers (line num…
Browse files Browse the repository at this point in the history
…bers not

being a particularly useful piece of information, since the reporter might
span several files and searching for WARN is easy enough!)


git-svn-id: http://scm.dspace.org/svn/repo/trunk@540 9c30dcfa-912a-0410-8fc2-9e0234be79fd
  • Loading branch information
rtansley committed Nov 11, 2002
1 parent 15340c7 commit 41ddc89
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions dspace/bin/log-reporter
Expand Up @@ -133,15 +133,15 @@ chomp $logdir;
my $line_count = 0;

# Okay, get on with it
my @warnings;
my $warnings = 0;
my @logins;
my @submissions;
my @installations;
my %item_views;
my @searches;
my %all_events;

foreach $logfile (<$logdir/dspace.log.*>)
foreach $logfile (<$logdir/dspace.log*>)
{
open (IN, $logfile);

Expand All @@ -154,12 +154,6 @@ foreach $logfile (<$logdir/dspace.log.*>)
# Sample log line:
# 2002-09-12 15:20:39,549 INFO org.dspace.content.Item @ rtansley@mit.edu:session_id=4C1D7E8E5C132788A87BD76C683C5CA2:update_item:item_id=2

# record warnings - sometimes these don't have the full header
if ($_ =~ /^(\d\d\d\d-\d\d\-\d\d) \d\d:\d\d:\d\d,\d\d\d WARN/)
{
push (@warnings, $line_count);
}

# Java class session ID parameters
# + + +
# date time level + user + action +
Expand Down Expand Up @@ -200,6 +194,12 @@ foreach $logfile (<$logdir/dspace.log.*>)

# consider adding current record into the summary

# record warnings
if ($level eq "WARN")
{
$warnings++;
}

# record logins
if ($action eq "login")
{
Expand Down Expand Up @@ -379,17 +379,7 @@ $summary .= "\n\n";


# summarize warnings
if (@warnings > 0)
{
my $warning;

$summary .= "Warnings (" . @warnings . " total):\n\n";
foreach $warning (@warnings)
{
$summary .= "line $warning\n";
}
$summary .= "\n\n";
}
$summary .= "Warnings: " . $warnings . "\n\n";


# summarize all events
Expand Down

0 comments on commit 41ddc89

Please sign in to comment.