From: Tomas Doran Date: Sun, 28 Mar 2010 17:24:18 +0000 (+0000) Subject: Back out behaviour change in debug logging we don't want, keeping only the addition... X-Git-Tag: 5.80022~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=3a4abdb3dd1fc51d2132d149f7f4757853312eed 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 --- diff --git a/Changes b/Changes index be7627f..3db89ea 100644 --- 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 diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index d2c045f..58c0505 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -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) - =item * Query keywords (see L) =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) +=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 (either request or response) to the debug logs.