You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by do...@apache.org on 2007/05/26 10:49:21 UTC

svn commit: r541872 - /spamassassin/branches/3.2/lib/Mail/SpamAssassin/Plugin/Rule2XSBody.pm

Author: dos
Date: Sat May 26 01:49:21 2007
New Revision: 541872

URL: http://svn.apache.org/viewvc?view=rev&rev=541872
Log:
bug 5477: prevent Rule2XSBody info message from appearing on stderr during spamd startup

Modified:
    spamassassin/branches/3.2/lib/Mail/SpamAssassin/Plugin/Rule2XSBody.pm

Modified: spamassassin/branches/3.2/lib/Mail/SpamAssassin/Plugin/Rule2XSBody.pm
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.2/lib/Mail/SpamAssassin/Plugin/Rule2XSBody.pm?view=diff&rev=541872&r1=541871&r2=541872
==============================================================================
--- spamassassin/branches/3.2/lib/Mail/SpamAssassin/Plugin/Rule2XSBody.pm (original)
+++ spamassassin/branches/3.2/lib/Mail/SpamAssassin/Plugin/Rule2XSBody.pm Sat May 26 01:49:21 2007
@@ -70,6 +70,16 @@
   $self->setup_test_set ($conf, $conf->{body_tests}, 'body');
 }
 
+sub compile_now_start {
+  my ($self) = @_;
+  # call info here (and no earlier) so that the message appears in the syslog
+  # but not on stderr when we start spamd
+  if (exists $self->{compiled_rules_log_msg_text}) {
+    info("zoom: $self->{compiled_rules_log_msg_text}") unless (would_log('dbg', 'zoom'));
+    delete $self->{compiled_rules_log_msg_text};
+  }
+}
+
 sub setup_test_set {
   my ($self, $conf, $test_set, $ruletype) = @_;
   foreach my $pri (keys %{$test_set}) {
@@ -148,8 +158,9 @@
     my $pc_zoomed   = ($found / ($totalhasrules || .001)) * 100;
     $pc_zoomed   = int($pc_zoomed * 1000) / 1000;
 
-    info("zoom: able to use $found/$totalhasrules '$ruletype' compiled ".
-        "rules ($pc_zoomed\%)");
+    $self->{compiled_rules_log_msg_text} = "able to use $found/".
+        "$totalhasrules '$ruletype' compiled rules ($pc_zoomed\%)";
+    dbg("zoom: $self->{compiled_rules_log_msg_text}");
 
     # TODO: issue a warning for low counts?
     # TODO: inhibit rule2xs scanning entirely for low counts?