On Mar 18, 2009, at 1:06 PM, Istvan Albert wrote:

> There is an issue in the tracker for this:
>
> http://code.google.com/p/pygr/issues/detail?id=61

Great!

> I'd say that to get it incorporated the logger module now currently
> under tests/testlib/logger.py would need to be copied/moved to the
> main pygr package, then each sys.stderr message would need be replaced
> with a call to logger.debug(), info(), warn() or error().

I guess that would mean we'd need a test suite for logger's  
functionality, since it's now being incorporated as part of Pygr?

>
>
> Probably it's best if only one module is migrated at once, to see how
> it works out in practice.
> The issue above also mentions the verbosity of these messages that
> would be best to be made shorter. It is fairly straightforward to do,
> all it needs some on-the-fly decision making on what   severity level
> corresponds to each of the messages. (severity levels rise in the
> order listed above).

There aren't *too* many cases where we currently print to stdout /  
stderr.  Changing these to logger calls should not break algorithmic  
correctness, so once logger itself is tested, I see no reason not to  
make this change in one clean sweep.

Release Management Question: is this a functionality change (and  
therefore delays the alpha release), or is this "debugging" that can  
occur after the alpha?

> The way I typically do it is that I have debug messages be littered
> throughout the code but these are suppressed by default and get turned
> on only when testing with higher verbosity modes (1 or 2). Info and
> above are printed by default.

I agree, with only one caveat.  Unlike a compiled language like C  
where debug messages can even be placed deep in inner loops, because  
compiling without debug flags takes them out during preprocessing, in  
an interpreted language like Python there is a performance hit for  
every debug statement (presumably an IF statement has to be executed  
for each one).  So this becomes unattractive in code where performance  
is important.  Do you know of any good way around this in Python?

-- Chris

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pygr-dev" group.
To post to this group, send email to pygr-dev@googlegroups.com
To unsubscribe from this group, send email to 
pygr-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pygr-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to