[Bioperl-l] verbosity and error stack, was accessing EMBL database

Chris Fields cjfields at illinois.edu
Thu Nov 19 15:30:34 UTC 2009


Mark, Dave,

This could be based on verbose(). 

          Level      w     t     d    st
verbose   < 0        -     +     -    -/+
verbose     0        +     +     -    -/+
verbose     1        +     +     +    +/+
verbose   > 1        +* -> +     +    +/+
* converts to throw()
w = warn
t = throw
d = debug
st = stack trace

warn() is set up that way now, you don't get a stack trace unless verbose() is > 0.  throw() could be the same; would be a simple fix, really.

My only problem with the current state of things is (I think we've delved down this path before) verbosity level is tied to exception strictness as seen above, and they're really two separate concepts, at least to me.  Verbosity of 1 or more doesn't necessarily mean I want an elevated level of strictness along with it.  For instance, one might want very strict exceptions w/o the noise, or (conversely) lots of debugging output but no warnings. 

(aside: another small nit, but I haven't exactly liked that the global level of strictness is designated by a env. variable with DEBUG in the name, but that's just me).

I've been thinking it would be nice to have simple separate verbose/strict switches (this is the way it's implemented in Biome).  This would allow some finer grained control over output:

          Level      d    st
verbose     0        -    -
verbose     1        +    +
Default = BIOPERLDEBUG || 0 # current situation

          Level      w     t
strict      -1       -     +
strict      0        +     +
strict      1        +* -> +
* converts to throw()
Default = BIOPERLSTRICT || 0

We could even allow finer-grained control of verbosity (states which cover all combinations) w/o affecting strictness.

chris

On Nov 19, 2009, at 8:17 AM, Mark A. Jensen wrote:

> I'm inclined to agree. Lots of responses to questions here that begin
> "Well, as the error message said, you need to check...", which means
> people tend towards "I broke it! Write the list!". I do find it hairy when
> my errors are way down in the object tree.
> ----- Original Message ----- From: "Dave Messina" <David.Messina at sbc.su.se>
> To: "Mark A. Jensen" <maj at fortinbras.us>
> Cc: <bioperl-l at bioperl.org>
> Sent: Thursday, November 19, 2009 9:04 AM
> Subject: Re: [Bioperl-l] accessing EMBL database
> 
> 
>> I would agree that the error message is not really informative.
> 
> Agreed that it could be better, but I wonder whether part of the problem with BioPerl error messages is the stack dump.
> 
> I think a lot of eyes just glaze right over when they see a big wad of complicated stuff, with colons and slashes and line numbers, spewing out at them.
> 
> Perhaps the stack dump should be turned off by default?
> 
> Wouldn't this:
> 
> ERROR: EMBL stream with no ID. Not embl in my book
> 
> 
> 
> Be a lot clearer than this?:
> 
> MSG: EMBL stream with no ID. Not embl in my book
> STACK: Error::throw
> STACK: Bio::Root::Root::throw C:/Perl/site/lib/Bio/Root/Root.pm: 368
> STACK: Bio::SeqIO::embl::next_seq C:/Perl/site/lib/Bio\SeqIO\embl.pm: 203
> STACK: Bio::DB::WebDBSeqI::get_Seq_by_acc C:/Perl/site/lib/Bio/DB/WebDBSeqI.pm: 194
> STACK: trial2.pl
> 
> 
> 
> Just a thought. This has probably been discussed before.
> Dave
> 
> 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l





More information about the Bioperl-l mailing list