On Wed, Jul 06, 2005 at 03:26:08PM -0400, Matt Sergeant wrote:
> This patch creates a circular loop with pluggable logging. My guess is 
> you haven't tested it with latest SVN :-)
> 
> My suggested change is something like this:
> 
> sub get_qmail_config {
>    my ($self, $config, $type) = @_;
> -  $self->log(LOGDEBUG, "trying to get config for $config");
> +  $self->log(LOGDEBUG, "trying to get config for $config") unless 
> $type and $type eq "NOLOG";
>    if ($self->{_config_cache}->{$config}) {
>      return wantarray ? @{$self->{_config_cache}->{$config}} : 
> $self->{_config_cache}->{$config}->[0];
>    }
> 
> So that you can pass in a NOLOG option to ->config() and it won't try 
> and log. And then for the plugin dir you can do:
> 
>    $self->config('plugin_dir', "NOLOG");
> 
> What do people think of the new NOLOG type of config?

It's quite a different beast to type => 'map' which is currently there,
and in principal you might have a map config you don't want to log for,
which overloading type wouldn't allow.

What about just using named arguments and honouring 'nolog => 1' or
something?

Cheers,
Gavin


Reply via email to