X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FLog.pm;h=de7a447afc3a5ea8afca8f584fc40b4320638201;hb=f7b672efdb91a057a449b353d157bb74761a2d94;hp=809294e326c8663e6179a2fb98e91cc5eab7103f;hpb=475616f8b8b4720721efd3a395197930832aba06;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Log.pm b/lib/Catalyst/Log.pm index 809294e..de7a447 100644 --- a/lib/Catalyst/Log.pm +++ b/lib/Catalyst/Log.pm @@ -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.