summaryrefslogtreecommitdiff
path: root/fml
diff options
context:
space:
mode:
authortmu <tmu>2003-06-25 13:10:50 +0000
committertmu <tmu>2003-06-25 13:10:50 +0000
commit8b75164304b3b3eeeb4107582876b3390ffc8674 (patch)
treee771a673258226a019dc1e25529405f18a08f568 /fml
parente2f2b6cabcb014084d2b107be42c44133548fa78 (diff)
downloadfml8-8b75164304b3b3eeeb4107582876b3390ffc8674.tar.gz
fml8-8b75164304b3b3eeeb4107582876b3390ffc8674.tar.bz2
fml8-8b75164304b3b3eeeb4107582876b3390ffc8674.zip
add $debug for debug message to Log at only debug-mode
Diffstat (limited to 'fml')
-rw-r--r--fml/lib/FML/Filter.pm14
-rw-r--r--fml/lib/FML/Header.pm10
2 files changed, 14 insertions, 10 deletions
diff --git a/fml/lib/FML/Filter.pm b/fml/lib/FML/Filter.pm
index 18137f03..713ee572 100644
--- a/fml/lib/FML/Filter.pm
+++ b/fml/lib/FML/Filter.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Filter.pm,v 1.28 2003/05/13 04:26:47 fukachan Exp $
+# $FML: Filter.pm,v 1.29 2003/05/14 12:02:00 fukachan Exp $
#
package FML::Filter;
@@ -14,6 +14,8 @@ use Carp;
use FML::Log qw(Log LogWarn LogError);
use ErrorStatus qw(error_set error error_clear);
+my $debug = 0;
+
=head1 NAME
FML::Filter - entry point for FML::Filter::* modules
@@ -73,12 +75,12 @@ sub article_filter
FUNCTION:
for my $function (@$functions) {
if ($config->yes( "use_${function}" )) {
- Log("filter(debug): check by $function");
+ Log("filter(debug): check by $function") if $debug;
my $fp = "_apply_$function";
$status = $self->$fp($curproc, $args, $message);
}
else {
- Log("filter(debug): not check by $function");
+ Log("filter(debug): not check by $function") if $debug;
}
last FUNCTION if $status;
@@ -249,7 +251,7 @@ sub _apply_article_mime_component_filter
$obj->mime_component_check($mesg);
}
else {
- Log("(debug) disabled since rule file not found");
+ Log("(debug) disabled since rule file not found") if $debug;
return 0;
}
@@ -372,12 +374,12 @@ sub command_mail_filter
FUNCTION:
for my $function (@$functions) {
if ($config->yes( "use_${function}" )) {
- Log("filter(debug): check by $function");
+ Log("filter(debug): check by $function") if $debug;
my $fp = "_apply_$function";
$status = $self->$fp($curproc, $args, $message);
}
else {
- Log("filter(debug): not check by $function");
+ Log("filter(debug): not check by $function") if $debug;
}
last FUNCTION if $status;
diff --git a/fml/lib/FML/Header.pm b/fml/lib/FML/Header.pm
index 9c3ddc48..156e34ef 100644
--- a/fml/lib/FML/Header.pm
+++ b/fml/lib/FML/Header.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Header.pm,v 1.59 2003/04/21 10:39:10 tmu Exp $
+# $FML: Header.pm,v 1.60 2003/05/03 03:26:54 fukachan Exp $
#
package FML::Header;
@@ -17,6 +17,8 @@ use FML::Log qw(Log LogWarn LogError);
use Mail::Header;
@ISA = qw(Mail::Header);
+my $debug = 0;
+
=head1 NAME
FML::Header - header manipulators
@@ -440,8 +442,8 @@ sub rewrite_date
$header->add('X-Date', $orgdate) if ($orgdate);
$header->replace('Date', $newdate);
- Log("(debug) rewrite the orginal date to 'X-Date: $orgdate'");
- Log("(debug) rewrite the new date to 'Date: $newdate'");
+ Log("(debug) rewrite the orginal date to 'X-Date: $orgdate'") if $debug;
+ Log("(debug) rewrite the new date to 'Date: $newdate'") if $debug;
}
@@ -462,7 +464,7 @@ sub rewrite_received
$header->add($new, $data);
}
$header->delete($org);
- Log("(debug) rewrite $org to $new (total $num)");
+ Log("(debug) rewrite $org to $new (total $num)") if $debug;
}