X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FLog.pm;h=de7a447afc3a5ea8afca8f584fc40b4320638201;hb=adee716c5ee8cda002acdaaa31764b72382101a3;hp=4b3c3c3b0e22b2129f033a6889527ea677863127;hpb=b5ecfcf07b8ffe7e9984f0279c8781ce51c6ac6a;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Log.pm b/lib/Catalyst/Log.pm index 4b3c3c3..de7a447 100644 --- a/lib/Catalyst/Log.pm +++ b/lib/Catalyst/Log.pm @@ -63,7 +63,7 @@ sub disable { sub _dump { my $self = shift; local $Data::Dumper::Terse = 1; - $self->info( Dumper( $_[0] ) ); + $self->info( Dumper( @_ ) ); } sub _log { @@ -81,11 +81,16 @@ sub _flush { $self->abort(undef); } else { - print( STDERR $self->body ); + $self->_send_to_log( $self->body ); } $self->body(undef); } +sub _send_to_log { + my $self = shift; + print STDERR @_; +} + 1; __END__ @@ -112,10 +117,9 @@ See L. =head1 DESCRIPTION -This module provides the default, simple logging functionality for -Catalyst. -If you want something different set C<$c->log> in your application -module, e.g.: +This module provides the default, simple logging functionality for Catalyst. +If you want something different set C<< $c->log >> in your application module, +e.g.: $c->log( MyLogger->new ); @@ -198,6 +202,14 @@ to use Log4Perl or another logger, you should call it like this: $c->log->abort(1) if $c->log->can('abort'); +=head2 _send_to_log + + $log->_send_to_log( @messages ); + +This protected method is what actually sends the log information to STDERR. +You may subclass this module and override this method to get finer control +over the log output. + =head1 SEE ALSO L.