You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by fe...@apache.org on 2004/10/11 23:42:37 UTC

svn commit: rev 54613 - spamassassin/trunk

Author: felicity
Date: Mon Oct 11 14:42:35 2004
New Revision: 54613

Modified:
   spamassassin/trunk/sa-learn.raw
Log:
new debug code wasn't updated in sa-learn, copied over the code from spamassassin script

Modified: spamassassin/trunk/sa-learn.raw
==============================================================================
--- spamassassin/trunk/sa-learn.raw	(original)
+++ spamassassin/trunk/sa-learn.raw	Mon Oct 11 14:42:35 2004
@@ -113,7 +113,7 @@
   'randseed=i'  => \$opt{'randseed'},
   'stopafter=i' => \$opt{'stopafter'},
 
-  'debug-level|D:s' => \$opt{'debug-level'},
+  'debug-level|D:s' => \$opt{'debug'},
   'help|h|?'        => \$opt{'help'},
   'version|V'       => \$opt{'version'},
 
@@ -145,6 +145,20 @@
   exit 0;
 }
 
+# set debug areas, if any specified (only useful for command-line tools)
+my @debug;
+if (defined $opt{'debug'}) {
+  if ($opt{'debug'}) {
+    @debug = split(/,/, $opt{'debug'});
+    if (grep { !/^\S+$/ } @debug) {
+      usage(0, "bad areas in --debug option!");
+    }
+  }
+  else {
+    @debug = ("all");
+  }
+}
+
 if ( $opt{'force-expire'} ) {
   $synconly = 1;
 }
@@ -186,7 +200,7 @@
     rules_filename      => $opt{'configpath'},
     site_rules_filename => $opt{'siteconfigpath'},
     userprefs_filename  => $opt{'prefspath'},
-    debug               => defined( $opt{'debug-level'} ),
+    debug               => \@debug,
     local_tests_only    => 1,
     dont_copy_prefs     => 1,
     PREFIX              => $PREFIX,