You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by he...@apache.org on 2021/05/02 07:44:07 UTC

svn commit: r1889387 - /spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/ReplaceTags.pm

Author: hege
Date: Sun May  2 07:44:06 2021
New Revision: 1889387

URL: http://svn.apache.org/viewvc?rev=1889387&view=rev
Log:
Improve logging

Modified:
    spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/ReplaceTags.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/ReplaceTags.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/ReplaceTags.pm?rev=1889387&r1=1889386&r2=1889387&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/ReplaceTags.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/ReplaceTags.pm Sun May  2 07:44:06 2021
@@ -135,7 +135,7 @@ sub finish_parsing_end {
         my $pre = $conf->{replace_pre}->{$pre_name};
         if ($pre) {
           s{($start.+?$end)}{$pre$1}  for @re;
-         }
+        }
       }
       if ($post_name) {
         my $post = $conf->{replace_post}->{$post_name};
@@ -172,12 +172,15 @@ sub finish_parsing_end {
       # do the actual replacement
       my ($rec, $err) = compile_regexp($re, 0);
       if (!$rec) {
-        info("replacetags: regexp compilation failed '$re': $err");
+        info("replacetags: regexp compilation failed for $rule: '$re': $err");
         next;
       }
       $conf->{test_qrs}->{$rule} = $rec;
-      #dbg("replacetags: replaced $rule: '$origre' => '$re'");
-      dbg("replacetags: replaced $rule");
+      if (would_log('dbg','replacetags') > 1) {
+        dbg("replacetags: replaced $rule: '$origre' => '$re'");
+      } else {
+        dbg("replacetags: replaced $rule");
+      }
     } else {
       dbg("replacetags: nothing was replaced in $rule");
     }