[Bioperl-l] global verbosity
Mark A. Jensen
maj at fortinbras.us
Thu Dec 4 11:01:44 EST 2008
[from the gmane link:
> Hilmar Lapp wrote:
>> Well, the rule would be:
>> 1) if a local (instance) verbosity has been set, use it
>> 2) otherwise, if a global (class, static) verbosity has been set,
>> use it
>> 3) otherwise, use a default value.
>> This would mean indeed that if you changed verbosity for a specific
>> instance it will be unaffected by global changes of the verbosity level.
I believe the solution follows those rules to the letter. The option for setting
as an arg in the constructor remains, and while the global $VERBOSITY is used as
the default for instances, this variable itself has a default (0), which I think
handles rule 3.
The patch allows the instance verbosity to be undefined, and remain so, falling
to the global if the getter is called before the setter. This and the global set
(which obviates a need to know the global symbol) may be the under-the-hood
here, though Hilmar's solution is elegant and small.
----- Original Message -----
From: "Sendu Bala" <bix at sendu.me.uk>
To: "Mark A. Jensen" <maj at fortinbras.us>
Cc: <bioperl-l at lists.open-bio.org>
Sent: Thursday, December 04, 2008 10:41 AM
Subject: Re: [Bioperl-l] global verbosity
> Mark A. Jensen wrote:
>> I was looking for a way to set verbosity globally (but not for
>> debugging), so that all subsequently created objects would be
>> absolutely quiet.
> I didn't look at your solution yet, but it might be instructive to read the
> previous discussion on this topic:
> It looks like I decided against implementing my own idea there, but if
> whatever you have in mind is similar and/or takes into account the issues
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
More information about the Bioperl-l