[Catalyst-commits] r13085 - in Catalyst-Runtime/5.80/trunk: . lib

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Sun Mar 28 17:24:18 GMT 2010


Author: t0m
Date: 2010-03-28 18:24:18 +0100 (Sun, 28 Mar 2010)
New Revision: 13085

Modified:
   Catalyst-Runtime/5.80/trunk/Changes
   Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm
Log:
Back out behaviour change in debug logging we don't want, keeping only the addition of 1 line of response info. More refactoring to give hooks to put the behaviour I just removed back from a plugin

Modified: Catalyst-Runtime/5.80/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.80/trunk/Changes	2010-03-28 16:54:36 UTC (rev 13084)
+++ Catalyst-Runtime/5.80/trunk/Changes	2010-03-28 17:24:18 UTC (rev 13085)
@@ -6,7 +6,10 @@
 
   Refactoring / optimizations:
    - Display of the end of hit debug messages has been factored out into
-     log_headers, log_request and log_response methods which all call
+     log_headers, log_request, log_request_headers, log_response and
+     log_response_headers methods so that plugins which customise how
+     much information is shown on the debug screen as easy to write.
+   - Make all logging of request and response state get the information from
      $c->dump_these so that there is a unified point from which to hook
      in parameter filtering (for example).
    - $c->model/view/controller have become a lot faster for non-regexp names

Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm	2010-03-28 16:54:36 UTC (rev 13084)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm	2010-03-28 17:24:18 UTC (rev 13085)
@@ -2108,8 +2108,6 @@
 
 =item * Request method, path, and remote IP address
 
-=item * Request headers (see L</log_headers>)
-
 =item * Query keywords (see L<Catalyst::Request/query_keywords>)
 
 =item * Request parameters
@@ -2134,7 +2132,7 @@
     $address ||= '';
     $c->log->debug(qq/"$method" request for "$path" from "$address"/);
 
-    $c->log_headers('request', $request->headers);
+    $c->log_request_headers($request->headers);
 
     if ( my $keywords = $request->query_keywords ) {
         $c->log->debug("Query keywords are: $keywords");
@@ -2153,8 +2151,10 @@
 
 =item * Response status code
 
-=item * Response headers (see L</log_headers>)
+=item * Content-Type header (if present)
 
+=item * Content-Length header (if present)
+
 =back
 
 =cut
@@ -2233,6 +2233,15 @@
     }
 }
 
+=head2 $c->log_request_headers($headers);
+
+Hook method which can be wrapped by plugins to log the request headers.
+No-op in the default implementation.
+
+=cut
+
+sub log_request_headers {}
+
 =head2 $c->log_headers($type => $headers)
 
 Logs L<HTTP::Headers> (either request or response) to the debug logs.




More information about the Catalyst-commits mailing list