Bug 7247 - rebuild_zebra.pl -v should show all Zebra log output
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 19 Nov 2011 10:49:53 +0000 (11:49 +0100)
committerPaul Poulain <paul.poulain@biblibre.com>
Tue, 17 Jan 2012 16:31:25 +0000 (17:31 +0100)
Currently, -v option resets Zebra log output to default system values.

This produce amount of log specified in system defaults which is usually
too low for debugging.

This change explicitly forces all Zebra log output which create much more
chatter so it triggers with verbosity level 2

Test scenario:
1. pick koha site to reindex
2. use -v -v options to rebuild_zebra.pl to see additional output

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Verified help corrections and  loglevel 2 output vs. loglevel 1 output. No issues found.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
misc/migration_tools/rebuild_zebra.pl

index fbfd3af..cd12277 100755 (executable)
@@ -34,7 +34,7 @@ my $want_help;
 my $as_xml;
 my $process_zebraqueue;
 my $do_not_clear_zebraqueue;
-my $verbose_logging;
+my $verbose_logging = 0;
 my $zebraidx_log_opt = " -v none,fatal,warn ";
 my $result = GetOptions(
     'd:s'           => \$directory,
@@ -51,7 +51,7 @@ my $result = GetOptions(
        'x'                             => \$as_xml,
     'y'             => \$do_not_clear_zebraqueue,
     'z'             => \$process_zebraqueue,
-    'v            => \$verbose_logging,
+    'v+'            => \$verbose_logging,
 );
 
 
@@ -96,8 +96,8 @@ if ($noshadow) {
 
 #  -v is for verbose, which seems backwards here because of how logging is set
 #    on the CLI of zebraidx.  It works this way.  The default is to not log much
-if ($verbose_logging) {
-    $zebraidx_log_opt = '';
+if ($verbose_logging >= 2) {
+    $zebraidx_log_opt = '-v none,fatal,warn,all';
 }
 
 my $use_tempdir = 0;
@@ -637,6 +637,7 @@ Parameters:
 
     -v                      increase the amount of logging.  Normally only 
                             warnings and errors from the indexing are shown.
+                            Use log level 2 (-v -v) to include all Zebra logs.
 
     -munge-config           Deprecated option to try
                             to fix Zebra config files.