From: Darold Date: Sat, 28 Jul 2012 09:43:02 +0000 (+0200) Subject: Remove obsolete -l | --logfile command line option, the -l option will be reused... X-Git-Tag: v3.2~179 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=41ffe81aa2d98b43e4e0fd8018fc65bc7ae0b844;p=pgbadger Remove obsolete -l | --logfile command line option, the -l option will be reused to spacify an incremental file --- diff --git a/README b/README index 1bf779f..56c9b77 100644 --- a/README +++ b/README @@ -14,11 +14,6 @@ SYNOPSIS Options: - -l | --logfile filename: path to the PostgreSQL log file to parse. It can - be a plain text log or a gzip compressed file - with the .gz extension. Note that this option is - DEPRECATED: set logfile as a command line argument - instead. To use stdin set it to character -. -f | --format logtype : possible values: syslog,stderr,csv. Default: stderr -o | --outfile filename: define the filename for the output. Default depends on the output format: out.html or out.txt. To dump diff --git a/doc/pgBadger.pod b/doc/pgBadger.pod index 3b24e32..0385bf6 100644 --- a/doc/pgBadger.pod +++ b/doc/pgBadger.pod @@ -17,11 +17,6 @@ Arguments: Options: - -l | --logfile filename: path to the PostgreSQL log file to parse. It can - be a plain text log or a gzip compressed file - with the .gz extension. Note that this option is - DEPRECATED: set logfile as a command line argument - instead. To use stdin set it to character -. -f | --format logtype : possible values: syslog,stderr,csv. Default: stderr -o | --outfile filename: define the filename for the output. Default depends on the output format: out.html or out.txt. To dump diff --git a/pgbadger b/pgbadger index ca52d63..f19682e 100755 --- a/pgbadger +++ b/pgbadger @@ -41,7 +41,6 @@ my $JQGRAPH = 1; # Command line options my $zcat = 'zcat'; -my $logfile = ''; my $format = ''; my $outfile = ''; my $outdir = ''; @@ -93,7 +92,6 @@ $num_sep = ' ' if ($n =~ /,/); # get the command line parameters my $result = GetOptions( - "l|logfile=s" => \$logfile, "f|format=s" => \$format, "o|outfile=s" => \$outfile, "h|help!" => \$help, @@ -137,9 +135,8 @@ if ($ver) { } &usage() if ($help); -# If we have command line argument and no -l option assume it's the list -# of log file to parse. -if (!$logfile && ($#ARGV >= 0)) { +# Log file to be parsed are passed as command line argument +if ($#ARGV >= 0) { foreach my $file (@ARGV) { if ($file ne '-') { die "FATAL: logfile $file must exist!\n" if (!-f $file); @@ -150,12 +147,6 @@ if (!$logfile && ($#ARGV >= 0)) { } push(@log_files, $file); } -} elsif ($logfile) { - if (!$logfile ne '-') { - die "FATAL: logfile $logfile must exist!\n" if (!-f $logfile); - die "FATAL: logfile $logfile is empty!\n" if (-z $logfile); - } - push(@log_files, $logfile); } # Logfile is a mandatory parameter @@ -368,7 +359,7 @@ my $nlines = 0; my $t0 = Benchmark->new; -foreach $logfile (@log_files) { +foreach my $logfile (@log_files) { &logmsg('DEBUG', "Starting to parse log file: $logfile"); # Open log file for reading @@ -612,11 +603,6 @@ Arguments: Options: - -l | --logfile filename: path to the PostgreSQL log file to parse. It can - be a plain text log or a gzip compressed file - with the .gz extension. Note that this option is - DEPRECATED, set logfile as a command line argument - instead. To use stdin set it to character -. -f | --format logtype : possible values: syslog,stderr,csv. Default: stderr -o | --outfile filename: define the filename for the output. Default depends of the output format: out.html or out.txt. To dump