X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=8db075a90f1cf44178a0b3648ab2d7e9effcec0c;hb=145074c2e045b36a52cefcfded0908b91013f9ea;hp=98c8776da70340f8a72443fd61fe2f346972cc4d;hpb=bc024080353d9982272a134e49e8601ed20c1a50;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 98c8776..8db075a 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -7,7 +7,7 @@ use Catalyst::Log; __PACKAGE__->mk_classdata($_) for qw/_config log/; -our $VERSION = '4.28'; +our $VERSION = '4.32'; our @ISA; =head1 NAME @@ -146,9 +146,15 @@ sub import { no strict 'refs'; *{"$caller\::handler"} = sub { Catalyst::Engine::handler( $caller, @_ ) }; - push @{"$caller\::ISA"}, $self; + + unless ( $caller->isa($self) ) { + push @{"$caller\::ISA"}, $self; + } + } + + unless ( $self->log ) { + $self->log( Catalyst::Log->new ); } - $self->log( Catalyst::Log->new ); # Options my $engine = @@ -157,7 +163,7 @@ sub import { if (/^\-Debug$/) { no warnings; no strict 'refs'; - *{"$self\::debug"} = sub { 1 }; + *{"$caller\::debug"} = sub { 1 }; $caller->log->debug('Debug messages enabled'); } elsif (/^-Engine=(.*)$/) { $engine = "Catalyst::Engine::$1" } @@ -191,6 +197,18 @@ sub import { $caller->log->debug(qq/Loaded engine "$engine"/) if $caller->debug; } +=item $c->log + +Contains the logging object. Unless it is already set Catalyst sets this up with a +C object. To use your own log class: + + $c->log( MyLogger->new ); + $c->log->info("now logging with my own logger!"); + +Your log class should implement the methods described in the C +man page. + + =back =head1 SUPPORT