perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r106748 - /perl/modperl/trunk/t/response/TestAPI/aplog.pm
Date Sat, 27 Nov 2004 19:50:29 GMT
Author: stas
Date: Sat Nov 27 11:50:29 2004
New Revision: 106748

URL: http://svn.apache.org/viewcvs?view=rev&rev=106748
Log:
more loglevel set fixes (for threaded mpms)

Modified:
   perl/modperl/trunk/t/response/TestAPI/aplog.pm

Modified: perl/modperl/trunk/t/response/TestAPI/aplog.pm
Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/response/TestAPI/aplog.pm?view=diff&rev=106748&p1=perl/modperl/trunk/t/response/TestAPI/aplog.pm&r1=106747&p2=perl/modperl/trunk/t/response/TestAPI/aplog.pm&r2=106748
==============================================================================
--- perl/modperl/trunk/t/response/TestAPI/aplog.pm	(original)
+++ perl/modperl/trunk/t/response/TestAPI/aplog.pm	Sat Nov 27 11:50:29 2004
@@ -28,8 +28,6 @@
     my $r = shift;
     my $s = $r->server;
 
-    my $orig_log_level = $s->loglevel;
-
     plan $r, tests => (@LogLevels * 2) + 20;
 
     my $logdiff = TestCommon::LogDiff->new($path);
@@ -131,6 +129,8 @@
     # XXX: at the moment we can't change loglevel after server startup
     # in a threaded mpm environment
     if (!Apache::MPM->is_threaded) {
+        my $orig_log_level = $s->loglevel;
+
         $s->loglevel(Apache::LOG_INFO);
 
         if ($s->error_fname) {
@@ -146,6 +146,7 @@
             qr/TestAPI::aplog test done/,
             '$slog->debug(sub { })';
 
+        $s->loglevel($orig_log_level);
     }
     else {
         ok 1;
@@ -155,7 +156,7 @@
     # notice() messages ignore the LogLevel value and always get
     # logged by Apache design (unless error log is set to syslog)
     if (!Apache::MPM->is_threaded) {
-        my $local_log_level = $s->loglevel;
+        my $orig_log_level = $s->loglevel;
 
         $r->server->loglevel(Apache::LOG_ERR);
         my $ignore = $logdiff->diff; # reset fh
@@ -165,7 +166,8 @@
         ok t_cmp $logdiff->diff,
             qr/[notice] .*? $msg/,
             "notice() logs regardless of LogLevel";
-        $s->loglevel($local_log_level);
+
+        $s->loglevel($orig_log_level);
     }
     else {
         ok 1;
@@ -200,9 +202,6 @@
     ok t_cmp $logdiff->diff,
         qr/\[warn\] warn test/,
         'overriden via export warn()';
-
-    # restore the orig LogLevel
-    $s->loglevel($orig_log_level);
 
     Apache::OK;
 }

Mime
View raw message