perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug MacEachern <do...@covalent.net>
Subject Re: Apache::Registry RFE
Date Thu, 01 Jun 2000 19:40:53 GMT
On Tue, 30 May 2000, Michael Blakeley wrote:

> Of course there was an error...
> 
> At 9:54 PM -0700 5/30/2000, Michael Blakeley wrote:
> 
> >>            $r->log_error($errsv) if $Apache::RegistryYA::AutoLog;
> 
> s/RegistryYA/Registry
> 
> I'm also having second thoughts about the binary nature of this 
> thing... I'd forgotten that $errsv might well be a text message like:
> 	Can't locate object method foo via package "Apache" at...
> which I'd quite like to see in the log.
> 
> So maybe...
> 
> $ diff -w Registry.pm.orig Registry.pm
> 26a27,28
> >  $Apache::Registry::AutoLog ||= 32768;
> >
> 155c157,160
> <           $r->log_error($errsv);
> ---
> >            {
> >               local $^W = 0;
> >               $r->log_error($errsv) if $Apache::Registry::AutoLog > 0+$errsv
> >            }
> 
> This way, setting $Apache::Registry::AutoLog = 300 gives me the 
> behavior I want (no extra log lines for 302, 304, 500) while still 
> letting "true" eval errors through. The default value should come 
> pretty close to the original behavior.

thanks for the patch, but we've stopped adding features to
Apache::Registry.  you can implement this with a subclass of
Apache::RegistryNG, something like so:

package My::Registry;

use Apache::RegistryNG (); 
@ISA = qw(Apache::RegistryNG);

sub log_error {
    my($r, $errsv) = @_;
    $r->SUPER::log_error($errsv) if $AutoLog > 0+$errsv
}

1;
__END__

PerlHandler My::Registry


Mime
View raw message