From: Tony B. <log...@tm...> - 2004-01-06 11:16:42
|
On Tue, Jan 06, 2004 at 10:59:13AM +0000, Tony Bowden wrote: > I'm getting a strange test failure in our framework on one machine and > not on another: > Can't call method "PRINT" on an undefined value at > /usr/share/perl5/Log/Log4perl/Appender/Screen.pm line 27. Hmmm. I doubt this has anything to do with Log4perl. I can reduce it now to: use IO::Scalar; local *STDERR = new IO::Scalar \my $data; print STDERR "Wibble wibble wibble\n"; print "Data = $data\n"; This seems to work on 5.8.1 and fail on 5.8.2. While I try to discover why that is, perhaps someone could tell me a better way to actually write this sort of test. Basically I need to test my application is issuing debugging messages correctly to STDERR. Previously I was just grabbing STDERR to a scalar and then testing that normally, but now that that's not working I should probably find a better way! My guess would be that in my test I would tell log4perl to use a different method of logging that's easier to test. It's not quite the same, but it's probably good enough. Is this a sensible approach, or is there a better way? If it's sensible, where's the best place to hook in to do that? Thanks, Tony |