Browse Source

Better testing on whether the logfile has data, and tell the user if the
logfile didn't have any lines, so he knows.

Morten Brix Pedersen 25 years ago
parent
commit
64ad314e65
1 changed files with 7 additions and 5 deletions
  1. 7 5
      pisg.pl

+ 7 - 5
pisg.pl

@@ -167,11 +167,13 @@ _END
         return undef;
     }
 
-    $generator->create_html()
-        if (defined $stats and $stats->{lines} > 0);# Create the HTML
-                                 # (look here if you want to remove some of the
-                                 # stats which you don't care about)
-
+    # Create our HTML page if the logfile has any data.
+    if (defined $stats and $stats->{totallines} > 0) {
+        $generator->create_html();
+    } elsif ($stats->{totallines} == 0) {
+        print STDERR "No lines found in logfile.. skipping.\n";
+    }
+    
     $conf->{chan_done}{$conf->{channel}} = 1;
 }