X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=58c05050fb87ae16f8b156116f80bdd3b9d34b3a;hp=3a43f544b947500d63df94d0033432dabd5e59ee;hb=3a4abdb3dd1fc51d2132d149f7f4757853312eed;hpb=13311c16a8aebc88a393baed64f3344e4c9a4229 diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 3a43f54..58c0505 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -1516,7 +1516,7 @@ sub welcome_message { models, and views; they can save you a lot of work.

-
script/${prefix}_create.pl -help
+
script/${prefix}_create.pl --help

Also, be sure to check out the vast and growing collection of plugins for Catalyst on CPAN; you are likely to find what you need there. @@ -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 @@ -2167,14 +2167,14 @@ sub log_response { my($dump) = grep {$_->[0] eq 'Response' } $c->dump_these; my $response = $dump->[1]; - $c->log->debug( - sprintf( - 'Response Code: %s; Content-Type: %s; Content-Length: %s', - $response->status || 'unknown', - $response->headers->header('Content-Type') || 'unknown', - $response->headers->header('Content-Length') || 'unknown' - ) - ); + $c->log->debug( + sprintf( + 'Response Code: %s; Content-Type: %s; Content-Length: %s', + $response->status || 'unknown', + $response->headers->header('Content-Type') || 'unknown', + $response->headers->header('Content-Length') || 'unknown' + ) + ); } =head2 $c->log_request_parameters( query => {}, body => {} ) @@ -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.