Skip to content

Commit

Permalink
Item1151: statistics script needed to be able to read log messages fr…
Browse files Browse the repository at this point in the history
…om old format logfiles, otherwise it would have been a functionality change in 1.0.3

git-svn-id: http://svn.foswiki.org/trunk@2716 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
CrawfordCurrie authored and CrawfordCurrie committed Feb 26, 2009
1 parent 8261bc2 commit 656f071
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion core/lib/Foswiki/Logger/PlainFile.pm
Expand Up @@ -90,7 +90,9 @@ sub log {
while ($this->SUPER::hasNext()) {
my @line = split(/\s*\|\s*/, $this->SUPER::next());
shift @line; # skip the leading empty cell
if ($line[0] =~ s/\s+$this->{_level}\s*$//) { # test the level
if ($line[0] =~ s/\s+$this->{_level}\s*$// # test the level
# accept a plain 'old' format date with no level only if reading info (statistics)
|| $line[0] =~ /^\d{1,2} [a-z]{3} \d{4}/i && $this->{_level} eq 'info') {
$line[0] = Foswiki::Time::parseTime($line[0]);
if ($line[0] >= $this->{_threshold}) { # test the time
$this->{_nextEvent} = \@line;
Expand Down
2 changes: 1 addition & 1 deletion core/lib/Foswiki/UI/Statistics.pm
Expand Up @@ -192,6 +192,7 @@ sub _collectLogData {
# $webTopic - what it happened to
# $extra - extra info, such as minor flag
# $remoteAddr = e.g. 127.0.0.5
$start = Foswiki::Time::parseTime($start);

my $data = {
viewRef => {}, # Hash of hashes, counts topic views by (web, topic)
Expand All @@ -208,7 +209,6 @@ sub _collectLogData {
while ( $it->hasNext() ) {
my $line = $it->next();
my $date = shift(@$line);

my ( $logFileUserName );

while ( !$logFileUserName && scalar(@$line) ) {
Expand Down

0 comments on commit 656f071

Please sign in to comment.