X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=768ad238520c1d384ed1318124b0ba0fa893a539;hb=f45789b1af1b76c31c498f4b713ab48a5f28ba0c;hp=b3abcafcafc0f795c9b4a7126caac722eeef5d22;hpb=aa6d250314e92cb95095d771defbbf0cada411e7;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index b3abcaf..768ad23 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -125,20 +125,21 @@ Returns a hashref containing your applications settings. sub import { my ( $class, @arguments ) = @_; + my $caller = caller(0); + + if ( $caller eq 'main' ) { + return; + } # Prepare inheritance unless ( $caller->isa($class) ) { no strict 'refs'; push @{"$caller\::ISA"}, $class; } - + if ( $caller->engine ) { - - unless ( $caller eq 'main' ) { - $caller->log->warn( qq/Attempt to re-initialize "$caller"/ ); - } - + $caller->log->warn( qq/Attempt to re-initialize "$caller"/ ); return; } @@ -148,7 +149,7 @@ sub import { foreach (@arguments) { if ( /^-Debug$/ ) { - $flags->{log} = 1 + $flags->{log} = ( $flags->{log} ) ? 'debug,' . $flags->{log} : 'debug'; } elsif (/^-(\w+)=?(.*)$/) { $flags->{ lc $1 } = $2; @@ -197,7 +198,7 @@ sub import { $t->setCols('Class'); $t->setColWidth( 'Class', 75, 1 ); $t->addRow($_) for @plugins; - $caller->log->debug( 'Loaded plugins', $t->draw ); + $caller->log->debug( "Loaded plugins:\n" . $t->draw ); } my $dispatcher = $caller->dispatcher;