From: Tomas Doran Date: Sun, 28 Mar 2010 18:25:41 +0000 (+0000) Subject: Make the tables from the log_headers method scale to term size nicely X-Git-Tag: 5.80022~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=f0e9921a9b807f883f868d95ec2ea2975669305c Make the tables from the log_headers method scale to term size nicely --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index bb2bad5..b742de0 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -2278,7 +2278,8 @@ sub log_headers { return unless $c->debug; - my $t = Text::SimpleTable->new( [ 35, 'Header Name' ], [ 40, 'Value' ] ); + my $column_width = Catalyst::Utils::term_width() - 28; + my $t = Text::SimpleTable->new( [ 15, 'Header Name' ], [ $column_width, 'Value' ] ); $headers->scan( sub { my ( $name, $value ) = @_;