]> granicus.if.org Git - pgbadger/commitdiff
print a warning when an empty log file is found
authorDarold <gilles@darold.net>
Sat, 21 Jul 2012 22:31:01 +0000 (00:31 +0200)
committerDarold <gilles@darold.net>
Sat, 21 Jul 2012 22:31:01 +0000 (00:31 +0200)
pgbadger

index 4bf30754eb6b9e1699e1580a19b22ddbeb661857..961d77768bb52b175bce1b79af4aaa56a8071f9a 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -143,7 +143,10 @@ if (!$logfile && ($#ARGV >= 0)) {
        foreach my $file (@ARGV) {
                if ($file ne '-') {
                        die "FATAL: logfile $file must exist!\n" if (!-f $file);
-                       next if (-z $file);
+                       if (-z $file) {
+                               print "WARNING: file $file is empty\n";
+                               next;
+                       }
                }
                push(@log_files, $file);
        }