Make the tables from the log_headers method scale to term size nicely
[catagits/Catalyst-Runtime.git] / 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 ) = @_;