[Apache-dispatch-devel] SF.net SVN: apache-dispatch: [66] trunk
Brought to you by:
geoffrey_young,
phred_moyer
|
From: <phr...@us...> - 2008-06-21 10:04:49
|
Revision: 66
http://apache-dispatch.svn.sourceforge.net/apache-dispatch/?rev=66&view=rev
Author: phred_moyer
Date: 2008-06-21 02:15:40 -0700 (Sat, 21 Jun 2008)
Log Message:
-----------
Reduce unnecessary log verbosity, especially when DispatchDebug is not set :)
Modified Paths:
--------------
trunk/Changes
trunk/lib/Apache/Dispatch/Util.pm
trunk/lib/Apache/Dispatch.pm
trunk/lib/Apache2/Dispatch.pm
Modified: trunk/Changes
===================================================================
--- trunk/Changes 2008-06-21 08:43:13 UTC (rev 65)
+++ trunk/Changes 2008-06-21 09:15:40 UTC (rev 66)
@@ -1,6 +1,7 @@
Revision history for Perl extension Apache::Dispatch
0.11
+ - reduce unnecessary log verbosity
- use Apache::Bootstrap to bootstrap mod_perl version
0.10 01.08.2008
Modified: trunk/lib/Apache/Dispatch/Util.pm
===================================================================
--- trunk/lib/Apache/Dispatch/Util.pm 2008-06-21 08:43:13 UTC (rev 65)
+++ trunk/lib/Apache/Dispatch/Util.pm 2008-06-21 09:15:40 UTC (rev 66)
@@ -193,12 +193,12 @@
$stat{$module} = $^T unless $stat{$module};
if ($INC{$module}) {
- $log->info("\tchecking $module for reload in pid $$...");
+ $log->debug("\tchecking $module for reload in pid $$...");
my $mtime = (stat $INC{$module})[9];
unless (defined $mtime && $mtime) {
- $log->warn("Apache::Dispatch cannot find $module!");
+ $log->error("Apache::Dispatch cannot find $module!");
return 1;
}
@@ -220,11 +220,11 @@
$stat{$module} = $mtime;
}
else {
- $log->info("\t$module not modified");
+ $log->debug("\t$module not modified");
}
}
else {
- $log->warn("Apache::Dispatch: $module not in \%INC!");
+ $log->error("Apache::Dispatch: $module not in \%INC!");
}
return 1;
@@ -327,8 +327,8 @@
(my $class_and_method = $r->uri) =~ s!/!::!g;
if ($newloc) {
- $log->info("\tmodifying location from ", $r->location, " to $newloc")
- if $debug > 1;
+ $log->debug("\tmodifying location from ", $r->location, " to $newloc")
+ if $debug > 1;
($location = $newloc) =~ s!/!::!g;
}
else {
@@ -355,7 +355,7 @@
}
unless ($times) {
- $log->info("\tLocation substitution failed - uri not translated")
+ $log->debug("\tLocation substitution failed - uri not translated")
if $debug > 1;
return (undef, undef);
@@ -390,7 +390,7 @@
my $coderef;
- $log->info("\tchecking the validity of $class->$method...")
+ $log->debug("\tchecking the validity of $class->$method...")
if $debug > 1;
if ($autoload) {
@@ -401,10 +401,10 @@
}
if ($coderef && $debug > 1) {
- $log->info("\t$class->$method is a valid method call");
+ $log->debug("\t$class->$method is a valid method call");
}
elsif ($debug > 1) {
- $log->info("\t$class->$method is not a valid method call");
+ $log->debug("\t$class->$method is not a valid method call");
}
return $coderef;
Modified: trunk/lib/Apache/Dispatch.pm
===================================================================
--- trunk/lib/Apache/Dispatch.pm 2008-06-21 08:43:13 UTC (rev 65)
+++ trunk/lib/Apache/Dispatch.pm 2008-06-21 09:15:40 UTC (rev 66)
@@ -88,12 +88,11 @@
# do some preliminary stuff...
#---------------------------------------------------------------------
- $log->info("Using Apache::Dispatch") if $debug;
+ $log->debug("Using Apache::Dispatch") if $debug;
# redefine $r as necessary for Apache::Filter 1.013 and above
if ($filter) {
- $log->info("\tregistering handler with Apache::Filter")
- if $debug > 1;
+ $log->debug("\tregistering handler with Apache::Filter") if $debug > 1;
# in case we used DispatchFilter directive instead, make sure
# that other filters in the chain recognize us...
@@ -104,21 +103,20 @@
$log = $r->server->log;
}
- $log->info("\tchecking $uri for possible dispatch...")
- if $debug > 1;
+ $log->debug("\tchecking $uri for possible dispatch...") if $debug > 1;
# if the uri contains any characters we don't like, bounce...
# is this necessary?
if (__PACKAGE__->bogus_uri($uri)) {
if ($debug) {
- $log->info("\t$uri has bogus characters...");
- $log->info("Exiting Apache::Dispatch");
+ $log->error("\t$uri has bogus characters...");
+ $log->debug("Exiting Apache::Dispatch") if $debug;
}
return DECLINED;
}
if ($debug > 1) {
- $log->info(
+ $log->debug(
"\tapplying the following dispatch rules:",
"\n\t\tDispatchPrefix: ",
$prefix,
@@ -151,9 +149,8 @@
__PACKAGE__->_translate_uri($r, $prefix, $new_location, $log, $debug);
unless ($class && $method) {
- $log->info("\tclass and method could not be discovered")
- if $debug;
- $log->info("Exiting Apache::Dispatch") if $debug > 0;
+ $log->error("\tclass and method could not be discovered");
+ $log->debug("Exiting Apache::Dispatch") if $debug;;
return DECLINED;
}
@@ -174,7 +171,7 @@
unless ($rc) {
$log->error("\tDispatchISA did not return successfully!");
- $log->info("Exiting Apache::Dispatch");
+ $log->debug("Exiting Apache::Dispatch") if $debug;
return DECLINED;
}
}
@@ -184,19 +181,17 @@
#---------------------------------------------------------------------
if ($require) {
- $log->info("\tattempting to require $class...")
- if $debug > 1;
+ $log->debug("\tattempting to require $class...") if $debug > 1;
eval "require $class";
if ($@) {
- $log->warn("\tcould not require $class: $@");
- $log->info("Exiting Apache::Dispatch");
+ $log->error("\tcould not require $class: $@");
+ $log->debug("Exiting Apache::Dispatch") if $debug;
return DECLINED;
}
else {
- $log->info("\t$class required successfully")
- if $debug > 1;
+ $log->debug("\t$class required successfully") if $debug > 1;
}
}
@@ -209,7 +204,7 @@
unless ($rc) {
$log->error("\tDispatchStat did not return successfully!");
- $log->info("Exiting Apache::Dispatch");
+ $log->debug("Exiting Apache::Dispatch") if $debug;
return DECLINED;
}
}
@@ -218,7 +213,7 @@
unless ($rc) {
$log->error("\tDispatchStat did not return successfully!");
- $log->info("Exiting Apache::Dispatch");
+ $log->debug("Exiting Apache::Dispatch") if $debug;
return DECLINED;
}
}
@@ -232,13 +227,11 @@
__PACKAGE__->_check_dispatch($object, $method, $autoload, $log, $debug);
if ($handler) {
- $log->info("\t$uri was translated into $class->$method")
- if $debug;
+ $log->debug("\t$uri was translated into $class->$method") if $debug;
}
else {
- $log->info("\t$uri did not result in a valid method")
- if $debug;
- $log->info("Exiting Apache::Dispatch");
+ $log->error("\t$uri did not result in a valid method");
+ $log->debug("Exiting Apache::Dispatch") if $debug;
return DECLINED;
}
@@ -287,11 +280,8 @@
# wrap up...
#---------------------------------------------------------------------
- $log->info("\tApache::Dispatch is returning $rc")
- if $debug;
-
- $log->info("Exiting Apache::Dispatch");
-
+ $log->debug("\tApache::Dispatch is returning $rc") if $debug;
+ $log->debug("Exiting Apache::Dispatch") if $debug;
return $rc;
}
Modified: trunk/lib/Apache2/Dispatch.pm
===================================================================
--- trunk/lib/Apache2/Dispatch.pm 2008-06-21 08:43:13 UTC (rev 65)
+++ trunk/lib/Apache2/Dispatch.pm 2008-06-21 09:15:40 UTC (rev 66)
@@ -55,7 +55,7 @@
# do some preliminary stuff...
#---------------------------------------------------------------------
- $log->debug("Using Apache2::Dispatch");
+ $log->debug("Using Apache2::Dispatch, debug level $debug") if $debug;
$log->debug("\tchecking $uri for possible dispatch...")
if $debug > 1;
@@ -64,13 +64,13 @@
if (__PACKAGE__->bogus_uri($uri)) {
if ($debug) {
- $log->info("\t$uri has bogus characters...");
- $log->info("Exiting Apache2::Dispatch");
+ $log->debug("\t$uri has bogus characters...");
+ $log->debug("Exiting Apache2::Dispatch");
}
return Apache2::Const::DECLINED;
}
- if ($debug > 1) {
- $log->debug(
+
+ $log->debug(
"\tapplying the following dispatch rules:",
"\n\t\tDispatchPrefix: ",
$prefix,
@@ -90,8 +90,7 @@
(@extras ? (join ' ', @extras) : "None"),
"\n\t\tDispatchISA: ",
(@parents ? (join ' ', @parents) : "None"),
- );
- }
+ ) if $debug > 1;
#---------------------------------------------------------------------
# create the new object
@@ -123,7 +122,7 @@
unless ($rc) {
$log->error("\tDispatchISA did not return successfully!");
- $log->info("Exiting Apache2::Dispatch");
+ $log->debug("Exiting Apache2::Dispatch") if $debug;
return Apache2::Const::DECLINED;
}
}
@@ -133,17 +132,17 @@
#---------------------------------------------------------------------
if ($require) {
- $log->info("\tattempting to require $class...");
+ $log->debug("\tattempting to require $class...") if $debug > 1;
eval "require $class";
if ($@) {
$log->warn("\tcould not require $class: $@");
- $log->info("Exiting Apache2::Dispatch");
+ $log->debug("Exiting Apache2::Dispatch") if $debug;
return Apache2::Const::DECLINED;
}
else {
- $log->info("\t$class required successfully");
+ $log->debug("\t$class required successfully") if $debug > 1;
}
}
@@ -156,7 +155,7 @@
unless ($rc) {
$log->error("\tDispatchStat did not return successfully!");
- $log->info("Exiting Apache2::Dispatch");
+ $log->debug("Exiting Apache2::Dispatch") if $debug;
return Apache2::Const::DECLINED;
}
}
@@ -165,7 +164,7 @@
unless ($rc) {
$log->error("\tDispatchStat did not return successfully!");
- $log->info("Exiting Apache2::Dispatch");
+ $log->debug("Exiting Apache2::Dispatch") if $debug;
return Apache2::Const::DECLINED;
}
}
@@ -178,11 +177,11 @@
my $handler = __PACKAGE__->_check_dispatch($object, $method, $autoload, $log, $debug);
if ($handler) {
- $log->info("\t$uri was translated into $class->$method");
+ $log->debug("\t$uri was translated into $class->$method") if $debug;
}
else {
- $log->info("\t$uri did not result in a valid method");
- $log->info("Exiting Apache2::Dispatch");
+ $log->error("\t$uri did not result in a valid method");
+ $log->debug("Exiting Apache2::Dispatch") if $debug;
return Apache2::Const::DECLINED;
}
@@ -228,9 +227,9 @@
# wrap up...
#---------------------------------------------------------------------
- $log->info("\tApache2::Dispatch is returning $rc");
+ $log->debug("\tApache2::Dispatch is returning $rc") if $debug;
- $log->info("Exiting Apache2::Dispatch");
+ $log->debug("Exiting Apache2::Dispatch") if $debug;
return $rc;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|