Missed bits
[catagits/CatalystX-Debug-ResponseHeaders.git] / lib / CatalystX / Debug / ResponseHeaders.pm
CommitLineData
019a8a6a 1package CatalystX::Debug::ResponseHeaders;
943c9be4 2use Moose::Role;
019a8a6a 3use namespace::autoclean;
4
5our $VERSION = '0.001';
6
943c9be4 7requires qw/
8 log_response_headers
9 log_response_status_line
10/;
019a8a6a 11
943c9be4 12around log_response_status_line => sub {};
019a8a6a 13
943c9be4 14around log_response_headers => sub {
15 my ($orig, $c, $headers) = @_;
019a8a6a 16
17 $c->log_headers('response', $headers);
18};
19
019a8a6a 201;
21
22=head1 NAME
23
943c9be4 24CatalystX::Debug::ResponseHeaders - Log the full response headers sent by your Catalyst application in debug mode
25
26=head1 SYNOPSIS
27
28 use Catalyst qw/
29 +CatalystX::Debug::ResponseHeaders
30 /;
019a8a6a 31
32=head1 DESCRIPTION
33
943c9be4 34Prints a L<Text::SimpleTable> style table containing all the headers sent from the
35user's browser to the application for each request when the application is in debug mode.
36
019a8a6a 37=head1 METHODS
38
943c9be4 39=head2 log_response_status_line
40
41Thie method is wrapped to stop the normal method being called. This suppresses the
42normal single line response status output.
43
44=head2 log_response_headers
45
46This hook method in L<Catalyst> is wrapped to call the L<Catalyst/log_headers> method
47for the request headers.
48
019a8a6a 49=head1 BUGS
50
943c9be4 51None known, but there probably are some.
52
53Patches are welcome, as are bug reports in the L<rt.cpan.org> bug tracker.
54
019a8a6a 55=head1 AUTHOR
56
943c9be4 57Tomas Doran (t0m) C<< <bobtfish@bobtfish.net> >>.
58
019a8a6a 59=head1 COPYRIGHT & LICENSE
60
943c9be4 61Copyright 2010 the above author(s).
019a8a6a 62
63This sofware is free software, and is licensed under the same terms as perl itself.
64
65=cut