From 6d269fcd13b626beed98de56d4bd47829f5835a2 Mon Sep 17 00:00:00 2001 From: Darold Date: Sun, 22 Jul 2012 00:31:01 +0200 Subject: [PATCH] print a warning when an empty log file is found --- pgbadger | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); } -- 2.40.0