Ack! Still didn't get it right. When we split the conditional into two
pieces, the return statement ended up in the wrong block. I just
checked in the change to cvs. We should release, since the bug
statements not to log if they occur when a stat of the config file is due.
sub generate_watch_code {
return <<'EOL';
print "exe_watch_code:\n" if DEBUG;
# more closures here
if ( ($LAST_CHECKED_AT + $WATCH_DELAY) < time()){
$LAST_CHECKED_AT = time();
print " Checking $FILE_TO_WATCH for changes ...\n" if DEBUG;
if ($LAST_CHANGED_AT < (stat($FILE_TO_WATCH))[9] ){
$LAST_CHANGED_AT = (stat(_))[9];
print " Config file has been modified\n" if DEBUG;
Log::Log4perl->init_and_watch($FILE_TO_WATCH, $WATCH_DELAY);
my $methodname = lc($level);
$logger->$methodname($message); # send the message
# to the new configuration
return; #and return, we're done with this incarnation
}
#return; Not here, fool! You haven't logged anything yet!
}
EOL
--
Happy Trails . . .
Kevin M. Goess
(and Anne and Frank)
904 Carmel Ave.
Albany, CA 94706
(510) 525-5217
|