X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=708c005f82912d5a97e367916be55da0db177167;hb=0f7ecc537d7a258023b1a58311f197ad5dca24c7;hp=e61d793459c7c867aa413e552b40625eec3e073f;hpb=c4695f3aa02151dcd257c01cdee3f70cfa2e5888;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index e61d793..708c005 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -4,6 +4,7 @@ use strict; use base 'Catalyst::Base'; use UNIVERSAL::require; use Catalyst::Log; +use Text::ASCIITable; __PACKAGE__->mk_classdata($_) for qw/engine log/; @@ -144,17 +145,17 @@ sub import { $caller->log->debug('Debug messages enabled'); } - my $engine ='Catalyst::Engine::CGI'; + my $engine = 'Catalyst::Engine::CGI'; if ( $ENV{MOD_PERL} ) { require mod_perl; if ( $mod_perl::VERSION >= 1.99 ) { - $engine ='Catalyst::Engine::Apache::MP2'; + $engine = 'Catalyst::Engine::Apache::MP2'; } else { - $engine ='Catalyst::Engine::Apache::MP1'; + $engine = 'Catalyst::Engine::Apache::MP1'; } } @@ -172,18 +173,21 @@ sub import { my $plugin = "Catalyst::Plugin::$_"; $plugin->require; - + if ($@) { $caller->log->error(qq/Couldn't load plugin "$plugin", "$@"/); } else { - push @plugins, " $plugin"; + push @plugins, " + $plugin"; no strict 'refs'; push @{"$caller\::ISA"}, $plugin; } } } - $caller->log->debug( 'Loaded plugins', @plugins ) + my $t = Text::ASCIITable->new; + $t->setCols('Class'); + $t->addRow($_) for @plugins; + $caller->log->debug( 'Loaded plugins', $t->draw ) if ( @plugins && $caller->debug ); # Engine