From: Gilles Darold Date: Mon, 11 Feb 2019 12:50:11 +0000 (+0100) Subject: Fix a call to autodetect_format(). X-Git-Tag: v10.3~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cae94b9462c5f37fc0eaf5dd824c898287eeb70f;p=pgbadger Fix a call to autodetect_format(). --- diff --git a/pgbadger b/pgbadger index 9339de1..8314ee1 100755 --- a/pgbadger +++ b/pgbadger @@ -1318,7 +1318,7 @@ if ($incremental && !$remote_host) else { # Auto detect log format for proper parsing - my $fmt = autodetect_format($f); + my $fmt = autodetect_format($f, $file_size{$f}); # Set regex to parse the log file $fmt = set_parser_regex($fmt); @@ -14438,8 +14438,7 @@ sub average_per_minutes sub autodetect_format { - my $file = shift; - my $totalsize = shift; + my ($file, $totalsize) = @_; # a file must be passed return if (!$file); @@ -14503,7 +14502,7 @@ sub autodetect_format } else { - &logmsg('DEBUG', "Can not autodetected log format from $file, using default"); + &logmsg('DEBUG', "Can not autodetect log format from $file, using default"); return 'default'; } @@ -15034,9 +15033,7 @@ sub get_file_size sub get_log_file { - my $logf = shift; - my $totalsize = shift; - my $sample_only = shift; + my ($logf, $totalsize, $sample_only) = @_; my $lfile = undef;