From: Mike S. <log...@pe...> - 2003-07-20 19:50:59
|
Hey guys, just discovered that we're reading the config file more often than necessary, here's a fix to only re-read the conf file if has really changed: Index: Logger.pm =================================================================== RCS file: /cvsroot/log4perl/Log-Log4perl/lib/Log/Log4perl/Logger.pm,v retrieving revision 1.53 diff -a -u -r1.53 Logger.pm --- Logger.pm 16 Jul 2003 09:06:22 -0000 1.53 +++ Logger.pm 20 Jul 2003 19:37:14 -0000 @@ -294,7 +294,8 @@ $watch_code = <<'EOL'; my($logger, $subname) = @_; - if(time() > $Log::Log4perl::Config::Watch::NEXT_CHECK_TIME) { + if(time() > $Log::Log4perl::Config::Watch::NEXT_CHECK_TIME and + $Log::Log4perl::Config::WATCHER->change_detected()) { Log::Log4perl->init_and_watch(); # Forward call to new configuration return $logger->$subname(); @@ -320,7 +321,8 @@ print "exe_watch_code:\n" if DEBUG; # more closures here - if(time() > $Log::Log4perl::Config::Watch::NEXT_CHECK_TIME) { + if(time() > $Log::Log4perl::Config::Watch::NEXT_CHECK_TIME and + $Log::Log4perl::Config::WATCHER->change_detected()) { Log::Log4perl->init_and_watch(); my $methodname = lc($level); -- Mike Mike Schilli log...@pe... http://perlmeister.com http://log4perl.sourceforge.net |