|
From: Mike S. <msc...@ao...> - 2003-10-01 00:52:43
|
Roland Bauer wrote:
> If I wrote init("$ENV{HOME}/log4perl.conf") this would be portable
> neither.
> It would be just *my* modules fault instead of Log4perl's fault ;-)
Exactly. What do you gain by omitting the path and relying on a default?
We can certainly discuss this, I'm just not (yet) seeing the benefit. Do
you have a scenario?
> >2) Is the function easy_init really necessary? Or - at least - could
> >init accept the same parameters?
> >
> >The following syntax seems ok:
> >
> >init($filename);
> >init(\$config_text);
> >init(\%key_value_pairs);
> >init($url);
> >
> >easy_init($ERROR); # where the string contains a number
> >easy_init(\%key_value_pairs);
> >easy_init(\%key_value_pairs_1, \%key_value_pairs_2, ...);
> >
> >If I am switching from
> >"easy" usage to "standard" usage, I have to
> >a) remove ':easy'
> >b) change easy_init to init
> >c) have to supply a config file name
> >
> >I'd like to omit step b) and c) ;-)
> >
> >Summary:
> >- the call of init without parameters should be ok (a default config
> > file should be searched
> >- importing ':easy' should signal that the user wants "easy" usage
> >- init should accept $DEBUG, ... as parameters (if ":easy" has been
> imported)
Sorry -- I did miss this question in your previous email. Actually,
there's two different ways to use qw(:easy):
1) use qw(:easy) and easy_init() - one-parameter-init plus macros
2) use qw(:easy) and init() - just use the DEBUG(), ERROR(), ... macros
I don't see an easy way of consolidating the two (and, we need to
maintain backwards-compatibility).
--
-- Mike
Mike Schilli
m...@pe...
|