Make the tables from the log_headers method scale to term size nicely
Tomas Doran [Sun, 28 Mar 2010 18:25:41 +0000 (18:25 +0000)]
lib/Catalyst.pm

index bb2bad5..b742de0 100644 (file)
@@ -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 ) = @_;