diff options
| author | fukachan <fukachan> | 2004-12-05 16:19:04 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2004-12-05 16:19:04 +0000 |
| commit | 90766f6d10ace4f05e689dd32363ef84a6366854 (patch) | |
| tree | 177d4aef3cac4d322b547f920b9f169f7d4f3f04 /fml/lib/FML/Process | |
| parent | 968cb03a8eacc447e78f01b0c12ce4eaeea53d4b (diff) | |
| download | fml8-90766f6d10ace4f05e689dd32363ef84a6366854.tar.gz fml8-90766f6d10ace4f05e689dd32363ef84a6366854.tar.bz2 fml8-90766f6d10ace4f05e689dd32363ef84a6366854.zip | |
define logdebug() to disable log messages.
modified to use proper log$role().
bug fix log messages if needed.
Diffstat (limited to 'fml/lib/FML/Process')
| -rw-r--r-- | fml/lib/FML/Process/CGI/Kernel.pm | 8 | ||||
| -rw-r--r-- | fml/lib/FML/Process/Command.pm | 22 | ||||
| -rw-r--r-- | fml/lib/FML/Process/Configure.pm | 4 | ||||
| -rw-r--r-- | fml/lib/FML/Process/Distribute.pm | 36 | ||||
| -rw-r--r-- | fml/lib/FML/Process/Error.pm | 8 | ||||
| -rw-r--r-- | fml/lib/FML/Process/Kernel.pm | 80 | ||||
| -rw-r--r-- | fml/lib/FML/Process/QueueManager.pm | 24 | ||||
| -rw-r--r-- | fml/lib/FML/Process/State.pm | 6 | ||||
| -rw-r--r-- | fml/lib/FML/Process/Utils.pm | 4 |
9 files changed, 108 insertions, 84 deletions
diff --git a/fml/lib/FML/Process/CGI/Kernel.pm b/fml/lib/FML/Process/CGI/Kernel.pm index d7267df4..c444dd12 100644 --- a/fml/lib/FML/Process/CGI/Kernel.pm +++ b/fml/lib/FML/Process/CGI/Kernel.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: Kernel.pm,v 1.82 2004/07/23 15:59:11 fukachan Exp $ +# $FML: Kernel.pm,v 1.83 2004/10/09 12:04:18 fukachan Exp $ # package FML::Process::CGI::Kernel; @@ -210,7 +210,7 @@ sub _cgi_resolve_ml_specific_variables $curproc->append_to_config_files_list($config_cf); } else { - $curproc->log("debug: no ml_name"); + $curproc->logdebug("no ml_name"); } $curproc->__debug_ml_xxx('cgi:'); @@ -228,7 +228,7 @@ sub _cgi_fix_log_file $config->set('ml_home_dir', $config->{ domain_local_tmp_dir }); $config->set('log_file', $config->{ domain_local_log_file }); - $curproc->log("debug: log_file = $config->{ log_file }"); + $curproc->logdebug("log_file = $config->{ log_file }"); } @@ -328,7 +328,7 @@ sub _error_string eval q{ $curproc->logerror($r); my ($k, $v); - while (($k, $v) = each %ENV) { $curproc->log("$k => $v");} + while (($k, $v) = each %ENV) { $curproc->logdebug("$k => $v");} }; } diff --git a/fml/lib/FML/Process/Command.pm b/fml/lib/FML/Process/Command.pm index 2bf03b03..a285a641 100644 --- a/fml/lib/FML/Process/Command.pm +++ b/fml/lib/FML/Process/Command.pm @@ -3,7 +3,7 @@ # Copyright (C) 2000,2001,2002,2003,2004 Ken'ichi Fukamachi # All rights reserved. # -# $FML: Command.pm,v 1.109 2004/07/23 12:58:26 fukachan Exp $ +# $FML: Command.pm,v 1.110 2004/07/23 15:59:08 fukachan Exp $ # package FML::Process::Command; @@ -156,16 +156,16 @@ sub _check_filter _arg_reason => $r, }; - $curproc->log("(debug) filter: inform rejection"); + $curproc->log("filter: inform rejection"); $filter->command_mail_filter_reject_notice($curproc,$msg_args); } else { - $curproc->log("filter: not inform rejection"); + $curproc->logdebug("filter: not inform rejection"); } # we should stop this process ASAP. $curproc->stop_this_process(); - $curproc->log("rejected by filter due to $r"); + $curproc->logerror("rejected by filter due to $r"); } }; $curproc->log($@) if $@; @@ -304,7 +304,7 @@ sub _command_process_loop $num_total++; # the total numer of non null lines if ($debug) { # save raw command buffer. - $curproc->log("(debug) input[$num_total]: $orig_command"); + $curproc->log("command: input[$num_total]: $orig_command"); } # XXX analyze the input command and set the result into $context. @@ -323,7 +323,7 @@ sub _command_process_loop # 1. stop here e.g. we processed "unsubscribe" above, so stop here. if ($curproc->command_context_get_normal_stop()) { $curproc->reply_message_nl('command.stop', "stopped."); - $curproc->log("command processing stop."); + $curproc->logdebug("command processing stop."); last COMMAND; } @@ -355,7 +355,7 @@ sub _command_switch if ($debug) { my $fixed_command = $context->{ fixed_command }; - $curproc->log("execute \"$fixed_command\""); + $curproc->log("command: execute \"$fixed_command\""); } # command restriction rules @@ -392,7 +392,7 @@ sub _command_switch } elsif ($result eq "deny") { $num_error++; - $curproc->log("deny command: $comname"); + $curproc->logerror("deny command: $comname"); $curproc->reply_message("\n$_prompt"); $curproc->restriction_state_reply_reason('command_mail', $msg_args); @@ -403,7 +403,7 @@ sub _command_switch $curproc->reply_message_nl("command.not_command", "no such command.", $msg_args); - $curproc->log("ignore command: $comname"); + $curproc->logdebug("ignore command: $comname"); } } else { @@ -477,7 +477,7 @@ sub _command_execute } else { # error trap my $reason = $@; - $curproc->log($reason); + $curproc->logerror($reason); $num_error++; @@ -486,7 +486,7 @@ sub _command_execute if ($reason =~ /^(.*)\s+at\s+/) { my $reason = $1; - $curproc->log($reason); # pick up reason + $curproc->logerror($reason); # pick up reason } } } diff --git a/fml/lib/FML/Process/Configure.pm b/fml/lib/FML/Process/Configure.pm index b4214b0c..68c79d97 100644 --- a/fml/lib/FML/Process/Configure.pm +++ b/fml/lib/FML/Process/Configure.pm @@ -3,7 +3,7 @@ # Copyright (C) 2001,2002,2003,2004 Ken'ichi Fukamachi # All rights reserved. # -# $FML: Configure.pm,v 1.65 2004/04/23 04:10:36 fukachan Exp $ +# $FML: Configure.pm,v 1.66 2004/07/11 15:43:39 fukachan Exp $ # package FML::Process::Configure; @@ -339,7 +339,7 @@ sub _makefml $curproc->logerror($r); if ($r =~ /^(.*)\s+at\s+/) { my $reason = $1; - $curproc->log($reason); # pick up reason + $curproc->logerror($reason); # pick up reason croak($reason); } } diff --git a/fml/lib/FML/Process/Distribute.pm b/fml/lib/FML/Process/Distribute.pm index 762240cb..3efeae0d 100644 --- a/fml/lib/FML/Process/Distribute.pm +++ b/fml/lib/FML/Process/Distribute.pm @@ -3,7 +3,7 @@ # Copyright (C) 2000,2001,2002,2003,2004 Ken'ichi Fukamachi # All rights reserved. # -# $FML: Distribute.pm,v 1.156 2004/08/15 10:29:42 fukachan Exp $ +# $FML: Distribute.pm,v 1.157 2004/11/03 23:26:52 fukachan Exp $ # package FML::Process::Distribute; @@ -169,16 +169,16 @@ sub _check_filter _arg_reason => $r, }; - $curproc->log("(debug) filter: inform rejection"); + $curproc->log("article_filter: inform rejection"); $filter->article_filter_reject_notice($curproc, $msg_args); } else { - $curproc->log("filter: not inform rejection"); + $curproc->logdebug("filter: not inform rejection"); } # we should stop this process ASAP. $curproc->stop_this_process(); - $curproc->log("rejected by filter due to $r"); + $curproc->logerror("rejected by filter due to $r"); } }; $curproc->log($@) if $@; @@ -187,7 +187,7 @@ sub _check_filter if ($eval) { eval qq{ $eval; }; $curproc->logwarn($@) if $@; } } else { - $curproc->log("debug: article_filter disabled"); + $curproc->logdebug("article_filter disabled"); } } @@ -237,7 +237,7 @@ sub run $curproc->_deliver_article_prep($args); } else { - $curproc->log("deny article submission"); + $curproc->logerror("deny article submission"); $curproc->stop_this_process(); # send back deny request with the original message. @@ -276,7 +276,7 @@ sub run } } else { - $curproc->logerror("ignore this request."); + $curproc->logwarn("ignore this request."); } # $curproc->unlock(); @@ -383,7 +383,7 @@ sub _deliver_article_prep $curproc->set_article_id($id); } else { - $curproc->log("returned article id=$id"); + $curproc->logerror("returned article id=$id"); $curproc->logerror("article sequence number not updated"); $curproc->unlock($lock_channel); $curproc->exit_as_tempfail(); # XXX LONG JUMP! @@ -393,7 +393,7 @@ sub _deliver_article_prep # XXX debug, remove here in the future if ($debug) { my $ha_msg = $curproc->{ article }->{ body }->data_type_list; - for my $msg (@$ha_msg) { $curproc->log("debug: $msg");} + for my $msg (@$ha_msg) { $curproc->logdebug($msg);} } # thread system checks the message before header rewritings. @@ -428,7 +428,7 @@ sub _deliver_article_prep if ($config->yes('use_html_archive')) { $curproc->log("htmlify article $id"); $curproc->_htmlify(); - $curproc->log("htmlify article $id end"); + $curproc->logdebug("htmlify article $id end"); } } @@ -468,7 +468,7 @@ sub _header_rewrite RULE: for my $rule (@$rules) { - $curproc->log("_header_rewrite( $rule )") if $config->yes('debug'); + $curproc->logdebug("_header_rewrite( $rule )"); if ($header->can($rule)) { # See FML::Header and FML::Header::* $header->$rule($config, { # for methods themself @@ -529,7 +529,7 @@ sub _deliver_article # SMTP-FROM is a must! unless ( $config->{'maintainer'} ) { - $curproc->log("not delivery for undefined \$maintainer"); + $curproc->logerror("not delivery for undefined \$maintainer"); return; } @@ -548,7 +548,7 @@ sub _deliver_article if (defined $queue) { $curproc->lock($lock_channel); - $curproc->log("article: qid=$qid"); + $curproc->logdebug("article: qid=$qid"); $queue->set('sender', $config->{ smtp_sender }); @@ -557,7 +557,7 @@ sub _deliver_article $queue->in($message); my $n = $queue->write_count(); - $curproc->log("queue: size=$n written"); + $curproc->logdebug("queue: size=$n written"); if ($queue->error()) { my $error = $queue->error(); $curproc->logerror("queue: $error"); @@ -567,7 +567,7 @@ sub _deliver_article $queue->lock( { lock_before_runnable => "yes" } ); unless ($queue->setrunnable()) { $curproc->logerror("queue: cannot setrunnable"); - $curproc->log("try to deliver on the fly"); + $curproc->logwarn("try to deliver on the fly"); $fatal = 1; } @@ -575,7 +575,7 @@ sub _deliver_article } # 2. distribute article - my $fp = sub { $curproc->log(@_);}; # pointer to the log function + my $fp = sub { $curproc->logdebug(@_);}; # pointer to the log function my $sfp = sub { my ($s) = @_; print $s; print "\n" if $s !~ /\n$/o;}; my $handle = undef; @@ -633,7 +633,7 @@ sub _deliver_article $curproc->unlock($lock_channel) unless defined $queue; if ($service->error) { - $curproc->log($service->error); + $curproc->logerror($service->error); $curproc->smtp_server_state_set_error(); } @@ -644,7 +644,7 @@ sub _deliver_article if (defined $queue) { $queue->remove(); $queue->unlock(); - $curproc->log("article: qid=$qid removed"); + $curproc->logdebug("article: qid=$qid removed"); } } diff --git a/fml/lib/FML/Process/Error.pm b/fml/lib/FML/Process/Error.pm index 63ffc476..cedf962e 100644 --- a/fml/lib/FML/Process/Error.pm +++ b/fml/lib/FML/Process/Error.pm @@ -3,7 +3,7 @@ # Copyright (C) 2002,2003,2004 Ken'ichi Fukamachi # All rights reserved. # -# $FML: Error.pm,v 1.45 2004/05/22 06:36:44 fukachan Exp $ +# $FML: Error.pm,v 1.46 2004/07/23 13:00:57 fukachan Exp $ # package FML::Process::Error; @@ -214,7 +214,7 @@ sub _clean_up_bouncers my $channel = 'error_mail_analyzer'; if ($curproc->is_event_timeout($channel)) { - $curproc->log("(debug) event timeout"); + $curproc->logdebug("event timeout"); eval q{ use FML::Error; @@ -228,7 +228,7 @@ sub _clean_up_bouncers $curproc->set_event_timeout($channel, time + 3600); } else { - $curproc->log("(debug) event not timeout"); + $curproc->logdebug("event not timeout"); } } @@ -283,7 +283,7 @@ sub finish $curproc->log("error message found"); } else { - $curproc->log("error message not found"); + $curproc->logwarn("error message not found"); } $curproc->inform_reply_messages(); diff --git a/fml/lib/FML/Process/Kernel.pm b/fml/lib/FML/Process/Kernel.pm index 95423384..1ec400f9 100644 --- a/fml/lib/FML/Process/Kernel.pm +++ b/fml/lib/FML/Process/Kernel.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: Kernel.pm,v 1.243 2004/11/25 12:25:56 fukachan Exp $ +# $FML: Kernel.pm,v 1.244 2004/11/30 04:14:59 fukachan Exp $ # package FML::Process::Kernel; @@ -364,12 +364,12 @@ sub lock if ($r) { my $t = time - $time_in; if ($t > 1) { - $curproc->log("lock channel=$channel requires $t sec."); + $curproc->logwarn("lock channel=$channel requires $t sec."); } $pcb->set('lock', $channel, $io); $LockInfo{ $channel } = 1; - $curproc->log("lock channel=$channel"); + $curproc->logdebug("lock channel=$channel"); } else { $curproc->logerror("cannot lock"); @@ -399,11 +399,11 @@ sub unlock if ($r) { my $t = time - $time_in; if ($t > 1) { - $curproc->log("unlock requires $t sec."); + $curproc->logwarn("unlock requires $t sec."); } delete $LockInfo{ $channel }; - $curproc->log("unlock channel=$channel"); + $curproc->logdebug("unlock channel=$channel"); } else { $curproc->logerror("cannot unlock"); @@ -652,7 +652,7 @@ sub simple_loop_check $match = $header->$rule($config) ? $rule : 0; } else { - $curproc->log("header->${rule}() is undefined"); + $curproc->logwarn("header->${rule}() is undefined"); } last RULE if $match; @@ -843,7 +843,7 @@ sub resolve_ml_specific_variables # lastly, we need to determine $ml_name and $ml_domain. # parse the argument such as "fml.pl /var/spool/ml/elena ..." unless ($ml_name) { - $curproc->log("(debug) parse @ARGV"); + $curproc->logdebug("parse ARGV = ( @ARGV )"); ARGS: for my $arg (@ARGV) { @@ -869,7 +869,7 @@ sub resolve_ml_specific_variables $config->set( 'ml_home_dir', $arg ); my $s = "ml_name=$ml_name ml_home_dir=$ml_home_dir"; - $curproc->log("(debug) $s"); + $curproc->logdebug("(debug) $s"); } } } @@ -1201,7 +1201,7 @@ sub _store_message_into_incoming_queue } unless ($fatal) { - $curproc->log("queued/incoming: qid=$queue_id read=$total"); + $curproc->logdebug("queued/incoming: qid=$queue_id read=$total"); $curproc->mail_queue_set_incoming_queue($queue); } else { @@ -1222,7 +1222,7 @@ sub _inject_charset_hints my $list = $msg->accept_language_list() || []; my $liststr = join("", @$list); - $curproc->log("hints: charset=\"$charset\" accept_language=[$liststr]"); + $curproc->logdebug("hints: charset=\"$charset\" accept_language=[$liststr]"); # 1. prefer Accept-Language: alyways, ignore Content-Type: in this case. # set $list even if $list == [] to avoid further warning. @@ -1238,7 +1238,7 @@ sub _inject_charset_hints my $char = new Mail::Message::Charset; my $lang = $char->message_charset_to_language($charset); - $curproc->log("hints: \"$charset\" => lang=\"$lang\" as a hint."); + $curproc->logdebug("hints: \"$charset\" => lang=\"$lang\" as a hint."); $curproc->set_language_hint('reply_message', $lang); $curproc->set_language_hint('template_file', $lang); } @@ -1287,7 +1287,7 @@ sub permit_post } if ($match) { - $curproc->log("match rule=$rule sender=$sender"); + $curproc->logdebug("match rule=$rule sender=$sender"); return($result eq "permit" ? 1 : 0); } } @@ -1464,6 +1464,9 @@ sub log_message elsif ($level eq 'error') { LogError($msg); } + elsif ($level eq 'debug') { + Log($msg); + } # update message queue $curproc->_log_message_queue_append({ @@ -1529,6 +1532,25 @@ sub logerror } +# Descriptions: log message as debug. +# Arguments: OBJ($curproc) STR($msg) HASH_REF($msg_args) +# Side Effects: none +# Return Value: none +sub logdebug +{ + my ($curproc, $msg, $msg_args) = @_; + my (@c) = caller; + + if (0) { + $curproc->log_message($msg, { + msg_args => $msg_args, + level => 'debug', + caller => \@c, + }); + } +} + + # Descriptions: informational message CUI shows logged # and forwarded into STDERR. # Arguments: OBJ($curproc) STR($msg) HASH_REF($msg_args) @@ -1945,7 +1967,7 @@ sub reply_message_nl }; my $s = "lang=$lang charset=($rm_charset, $tf_charset) class=$class"; - $curproc->log("reply_message_nl: $s") if $rm_debug; + $curproc->logdebug("reply_message_nl: $s") if $rm_debug; $curproc->_reply_message_nl($class, $default_msg, $rm_args, $charsets); } } @@ -2140,7 +2162,8 @@ sub get_preferred_languages my $p = $curproc->__find_preferred_languages($pref_order, $acpt_lang_list, $mime_lang); - $curproc->log("hints: preferred language = [ @$p ]") unless $first_time++; + $curproc->logdebug("hints: preferred language = [ @$p ]") + unless $first_time++; return $p; } @@ -2205,8 +2228,9 @@ sub __find_preferred_languages print STDERR " mime language = \" $orig_mime_lang \"\n"; print STDERR "preferred languge = [ @$selected ]\n"; print STDERR "\n"; - $curproc->log("pref_order=[@$pref_order] acpt=[@$acpt_lang_list]"); - $curproc->log("mime_lang=$orig_mime_lang selected=[@$selected]"); + $curproc->logdebug("pref_order=[@$pref_order]"); + $curproc->logdebug("acpt lang =[@$acpt_lang_list]"); + $curproc->logdebug("mime_lang=$orig_mime_lang selected=[@$selected]"); } if (@$selected) { @@ -2354,7 +2378,7 @@ sub queue_in my @lang = keys %lang_count; if ($#lang > 0) { - $curproc->log("plural languages, so use mulitpart"); + $curproc->logdebug("plural languages, so use mulitpart"); $is_multipart = 1; } } @@ -2377,10 +2401,10 @@ sub queue_in } - $curproc->log("debug: queue_in: sender=$sender"); - $curproc->log("debug: queue_in: recipient=$rcptkey"); - $curproc->log("debug: queue_in: rcptlist=[ @$rcptlist ]"); - $curproc->log("debug: queue_in: is_multipart=$is_multipart"); + $curproc->logdebug("queue_in: sender=$sender"); + $curproc->logdebug("queue_in: recipient=$rcptkey"); + $curproc->logdebug("queue_in: rcptlist=[ @$rcptlist ]"); + $curproc->logdebug("queue_in: is_multipart=$is_multipart"); ############################################################### @@ -2466,7 +2490,7 @@ sub queue_in } else { # $curproc->log("queue_in: type=<$t> aggregated") if $t eq 'text'; - $curproc->log("queue_in: unknown type=<$t>") unless $t eq 'text'; + $curproc->logerror("queue_in: unknown type=<$t>") unless $t eq 'text'; } } } @@ -2494,7 +2518,7 @@ sub queue_in $s .= $q; } else { - $curproc->log("queue_in: unknown typ $t"); + $curproc->logerror("queue_in: unknown type $t"); } } } @@ -2539,12 +2563,12 @@ sub queue_in $queue->set('recipient_maps', $rcptmaps); } - $queue->in( $msg ) && $curproc->log("queued/new: qid=$qid"); + $queue->in( $msg ) && $curproc->logdebug("queued/new: qid=$qid"); if ($queue->setrunnable()) { - $curproc->log("queued/active: qid=$qid runnable"); + $curproc->logdebug("queued/active: qid=$qid runnable"); } else { - $curproc->log("queue: qid=$qid broken"); + $curproc->logerror("queue: qid=$qid broken"); } # return queue object @@ -2623,7 +2647,7 @@ sub clean_up_tmpfiles if (defined $queue) { for my $q (@$queue) { - $curproc->log("unlink $q"); + $curproc->logdebug("unlink $q"); unlink $q; } } @@ -3034,7 +3058,7 @@ sub finalize } if ($debug > 100) { - $curproc->log("debug: dump curproc structure"); + $curproc->logdebug("debug: dump curproc structure"); eval q{ use FML::Process::Debug; my $obj = new FML::Process::Debug; diff --git a/fml/lib/FML/Process/QueueManager.pm b/fml/lib/FML/Process/QueueManager.pm index 5c5233ca..8632d962 100644 --- a/fml/lib/FML/Process/QueueManager.pm +++ b/fml/lib/FML/Process/QueueManager.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: QueueManager.pm,v 1.29 2004/09/03 13:56:42 fukachan Exp $ +# $FML: QueueManager.pm,v 1.30 2004/09/04 03:14:17 fukachan Exp $ # package FML::Process::QueueManager; @@ -84,7 +84,7 @@ sub send my $count_ok = 0; my $count_err = 0; my $channel = 'qmgr_reschedule'; - my $fp = sub { $curproc->log(@_);}; + my $fp = sub { $curproc->logdebug(@_);}; use Mail::Delivery::Queue; my $queue = new Mail::Delivery::Queue { directory => $queue_dir }; @@ -99,7 +99,7 @@ sub send $queue->set_policy("fair-queue"); $ra = $queue->list(); unless (@$ra) { - $curproc->log("qmgr: empty active queue. re-schedule"); + $curproc->logdebug("qmgr: empty active queue. re-schedule"); $queue->reschedule(); $ra = $queue->list(); } @@ -125,7 +125,7 @@ sub send $count_ok++; } else { - $curproc->log("qmgr: qid=$qid try later."); + $curproc->logwarn("qmgr: qid=$qid try later."); $q->unlock(); $q->sleep_queue(); $is_locked = 0; @@ -135,13 +135,13 @@ sub send } else { # XXX-TODO: $q->remove() if invalid queue ? - $curproc->log("qmgr: qid=$qid is invalid"); + $curproc->logerror("qmgr: qid=$qid is invalid"); } $q->unlock() if $is_locked; } else { - $curproc->log("qmgr: qid=$qid is locked. retry"); + $curproc->logwarn("qmgr: qid=$qid is locked. retry"); } # upper limit of processing done on one process. @@ -149,12 +149,12 @@ sub send } if ($count) { - $curproc->log("qmgr: $count requests processed: ok=$count_ok/$count"); + $curproc->logdebug("qmgr: $count requests processed: ok=$count_ok/$count"); } if ($curproc->is_event_timeout($channel)) { if (defined $queue) { - $curproc->log("qmgr: re-schedule"); + $curproc->logdebug("qmgr: re-schedule"); $queue->reschedule(); } $curproc->set_event_timeout($channel, time + 300); @@ -190,10 +190,10 @@ sub _send }); if ($r) { - $curproc->log("qmgr: qid=$qid status=sent"); + $curproc->logdebug("qmgr: qid=$qid status=sent"); } else { - $curproc->log("qmgr: qid=$qid status=fail"); + $curproc->logerror("qmgr: qid=$qid status=fail"); } return $r; @@ -216,7 +216,7 @@ sub cleanup my ($self) = @_; my $curproc = $self->{ _curproc }; my $queue_dir = $self->{ _directory }; - my $fp = sub { $curproc->log(@_);}; + my $fp = sub { $curproc->logdebug(@_);}; use Mail::Delivery::Queue; my $queue = new Mail::Delivery::Queue { directory => $queue_dir }; @@ -238,7 +238,7 @@ sub cleanup # enough old. if ($mtime < $now - $limit) { - $curproc->log("qmgr: remove too old queue qid=$qid"); + $curproc->logdebug("qmgr: remove too old queue qid=$qid"); $q->remove(); } } diff --git a/fml/lib/FML/Process/State.pm b/fml/lib/FML/Process/State.pm index b1c5152e..c7b43b9d 100644 --- a/fml/lib/FML/Process/State.pm +++ b/fml/lib/FML/Process/State.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: State.pm,v 1.15 2004/08/13 15:02:49 fukachan Exp $ +# $FML: State.pm,v 1.16 2004/09/28 13:37:10 fukachan Exp $ # package FML::Process::State; @@ -95,7 +95,7 @@ sub restriction_state_set_deny_reason my $pcb = $curproc->pcb(); $pcb->set("check_restrictions", "deny_reason", $reason); - $curproc->log("restriction_state_set_deny_reason: $reason") if $debug; + $curproc->logdebug("restriction_state_set_deny_reason: $reason") if $debug; } @@ -122,7 +122,7 @@ sub restriction_state_reply_reason my $rule = $curproc->restriction_state_get_deny_reason(); - $curproc->log("restriction_state_reply_reason: $rule") if $debug; + $curproc->logdebug("restriction_state_reply_reason: $rule") if $debug; if ($rule eq 'reject_system_special_accounts') { my $r = "deny request from a system account"; diff --git a/fml/lib/FML/Process/Utils.pm b/fml/lib/FML/Process/Utils.pm index ce073d2c..ca3686f7 100644 --- a/fml/lib/FML/Process/Utils.pm +++ b/fml/lib/FML/Process/Utils.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: Utils.pm,v 1.125 2004/11/21 07:00:34 fukachan Exp $ +# $FML: Utils.pm,v 1.126 2004/11/25 12:20:06 fukachan Exp $ # package FML::Process::Utils; @@ -387,7 +387,7 @@ sub _mkpath_str use File::Path; mkpath([ \$dir ], 0, $mode); chmod $mode, \$dir; - \$curproc->log(\"mkdirhier \$dir mode=$mode\"); + \$curproc->log(\"mkdir \$dir mode=$mode\"); }; $curproc->logerror($@) if $@; } |
