Back out behaviour change in debug logging we don't want, keeping only the addition...
Tomas Doran [Sun, 28 Mar 2010 17:24:18 +0000 (17:24 +0000)]
Changes
lib/Catalyst.pm

diff --git a/Changes b/Changes
index be7627f..3db89ea 100644 (file)
--- a/Changes
+++ b/Changes
@@ -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
index d2c045f..58c0505 100644 (file)
@@ -2108,8 +2108,6 @@ Writes information about the request to the debug logs.  This includes:
 
 =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 @@ sub log_request {
     $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,7 +2151,9 @@ Writes information about the response to the debug logs.  This includes:
 
 =item * Response status code
 
-=item * Response headers (see L</log_headers>)
+=item * Content-Type header (if present)
+
+=item * Content-Length header (if present)
 
 =back
 
@@ -2233,6 +2233,15 @@ sub log_request_uploads {
     }
 }
 
+=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.