From: Viner, D. <dv...@ya...> - 2004-01-03 00:13:52
|
hi all, I've been trying to reach dave rolsky with this question... it seems like log::dispatch version 2.07 and 2.08 fail on windows ... http://testers.cpan.org/show/Log-Dispatch.html#Log-Dispatch-2.08 anyone here have the inside scoop on log::dispatch? thanks dave > -----Original Message----- > From: Viner, David > Sent: Tuesday, December 23, 2003 10:56 AM > To: 'au...@ur...' > Subject: Log::Dispatch-2.08 on win32 > > Hi, > > I've been trying to build and run the tests for Log::Dispatch-2.08 on > win32, but it fails. The problem is in test 128 in t/01-basic.t which > tests the chmodded permissions of a log file. The problem is that on > windows 0777 is equivalent to 0666 ( i think ). In other words, this > script: > > #!/usr/local/bin/perl -w > use strict; > umask(0000); > my $f= "test-chmod.tmp"; > open(F,">$f") or die("Can't open $f"); > print F "HI"; > close(F); > > my $mode = (stat($f))[2] > or die "Cannot stat $f: $!"; > my $mode_string = sprintf( '%04o', $mode & 07777 ); > print "MODE: $mode_string\n"; > > chmod(0777,$f); > > my $mode2 = (stat($f))[2] > or die "Cannot stat $f: $!"; > my $mode_string2 = sprintf( '%04o', $mode2 & 07777 ); > print "MODE: $mode_string2\n"; > > > exit; > > Will output the following: > MODE: 0666 > MODE: 0666 > > I'm not a win32 expert, but this small change to the test file will make > it work: > # 129 - 131 - would_log > { > my $dispatch = Log::Dispatch->new; > > $dispatch->add( Log::Dispatch::File->new( name => 'file1', > min_level => 'warning', > filename => './would_test.log' > ) ); > > ok( !$dispatch->would_log('foo'), > "will not log 'foo'" ); > > ok( ! $dispatch->would_log('debug'), > "will not log 'debug'" ); > > ok( $dispatch->would_log('crit'), > "will log 'crit'" ); > > unlink './would_test.log' > or diag( "Can't remove ./would_test.log: $!" ); > } > > > What do you think? > > dave |