From: Kevin G. <ke...@go...> - 2002-09-20 18:51:25
|
The worst that can happen is that if a user has the watch delay set to N, not more than 1 log statement every N will not be logged. If watch delay is set to 60 minutes and they issue a log message every minute, after 120 minutes they'll only have 118 statements in their log file. I checked in changes to 017Watch.t to demonstrate it, here's what the change looks like: RCS file: /cvsroot/log4perl/Log-Log4perl/t/017Watch.t,v retrieving revision 1.2 diff -u -r1.2 017Watch.t --- t/017Watch.t 3 Aug 2002 19:22:18 -0000 1.2 +++ t/017Watch.t 20 Sep 2002 18:44:31 -0000 @@ -61,13 +61,16 @@ $logger->debug('2nd debug message'); $logger->info('2nd info message'); +print "sleeping for 3 secs\n"; +sleep 3; +$logger->info('2nd info message again'); open (LOG, $testfile) or die "can't open $testfile $!"; my @log = <LOG>; close LOG; my $log = join('',@log); -ok($log, "INFO - info message\nDEBUG animal.dog N/A - 2nd debug message\nINFO animal.dog N/A - 2nd info message\n"); +ok($log, "INFO - info message\nDEBUG animal.dog N/A - 2nd debug message\nINFO animal.dog N/A - 2nd info message\nINFO animal.dog N/A - 2nd info message again\n"); # *************************************************************** # do it 3rd time @@ -98,7 +101,7 @@ close LOG; $log = join('',@log); -ok($log, "INFO - info message\nDEBUG animal.dog N/A - 2nd debug message\nINFO animal.dog N/A - 2nd info message\nINFO - 3rd info message\n"); +ok($log, "INFO - info message\nDEBUG animal.dog N/A - 2nd debug message\nINFO animal.dog N/A - 2nd info message\nINFO animal.dog N/A - 2nd info message again\nINFO - 3rd info message\n"); BEGIN {plan tests => 2}; Msc...@ao... wrote: > In a message dated 9/19/02 12:13:06 PM Pacific Daylight Time, > ke...@go... writes: > > >> We should release, since the bug >> statements not to log if they occur when a stat of the config file is >> due. > > > > What's the worst that could happen with the previous release? I remember > I ran a couple of very rudimentary tests and they worked. Also, could > you please add a bunch of test cases that fail in the old case and > succeed with the new code? > > -- Mike > > Mike Schilli > log...@pe... > http://perlmeister.com > http://log4perl.sourceforge.net -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |