From: Darold Date: Sat, 21 Jul 2012 22:31:01 +0000 (+0200) Subject: print a warning when an empty log file is found X-Git-Tag: v3.2~182 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6d269fcd13b626beed98de56d4bd47829f5835a2;p=pgbadger print a warning when an empty log file is found --- diff --git a/pgbadger b/pgbadger index 4bf3075..961d777 100755 --- 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); }