[Catalyst] Redirecting the log

Ovid publiustemp-catalyst at yahoo.com
Fri Jan 13 18:54:35 CET 2006


I'm guessing that silence doesn't imply consent in this case.  Does
this mean that *no* patch is desired here?  Am I stuck with this
behavior?

Cheers,
Ovid

--- Ovid <publiustemp-catalyst at yahoo.com> wrote:

> Hi all,
> 
> I know that Catalyst::Log has instructions for using a different
> logger, but rather than use a different one, I'd rather just be able
> to
> alter one tiny piece of behavior in the current one.  Right now, the
> "_flush" method is defined as follows:
> 
>   sub _flush {
>       my $self = shift;
>       if ( $self->abort || !$self->body ) {
>           $self->abort(undef);
>       }
>       else {
>           print( STDERR $self->body );
>       }
>       $self->body(undef);
>   }
> 
> That "print STDERR" is causing me some difficulties.  There are other
> things I would like to do with that.  What I would much rather do is
> this:
> 
>   sub _flush {
>       my $self = shift;
>       if ( $self->abort || !$self->body ) {
>           $self->abort(undef);
>       }
>       else {
>           $self->send_to_log( $self->body );
>       }
>       $self->body(undef);
>   }
> 
>   sub send_to_log {
>       my $self = shift;
>       print STDERR @_;
>   }
> 
> Then, to alter that behavior, I just subclass Catalyst::Log and alter
> that one method.  Before I change the code and submit a patch, is
> there
> anything I'm missing or is there a better way of handling this?
> 
> Also, I can't recall if patches are preferred inline or as
> attachments.
> 
> Cheers,
> Ovid
> 
> -- 
> If this message is a response to a question on a mailing list, please
> send follow up questions to the list.
> 
> Web Programming with Perl --
> http://users.easystreet.com/ovid/cgi_course/
> 
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
> 


-- 
If this message is a response to a question on a mailing list, please send follow up questions to the list.

Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/



More information about the Catalyst mailing list