eftsung / pygr

Automatically exported from code.google.com/p/pygr
0 stars 0 forks source link

adding logging functionality #61

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Purpose of code changes on this branch:

Adding better message logging facilities. Python offers a well behaved
logging module that can be used to format and filter messages. We should
replace all print >>stderr messages with logging calls. 

logger.info, logger.warn etc.

See code here:
http://github.com/ialbert/pygr-windows/blob/bed6da2befb2d01bcf5e9ceebdca6115849a
1b00/pygr/logger.py

The code above prints the level information, module and function that sent
the message and the message itself for example:

DEBUG  blast.blast_program Could not start the process

Potential pitfall: backwards compatibility (older pythons may have fewer
formatting options)

Original issue reported on code.google.com by istvan.a...@gmail.com on 14 Jan 2009 at 2:23

GoogleCodeExporter commented 8 years ago
The backwards compatibility will definitely be a problem; are there ways to use 
a
subset that was present in 2.2?

Original comment by the.good...@gmail.com on 14 Jan 2009 at 3:54

GoogleCodeExporter commented 8 years ago
I think it is just the issue of wether we can use the 'funcName' formatting 
option
(that is extremely handy), that pulls out the function context and appeared in 
2.4 or
so. It think we can just branch off and have a simpler formatting option for 
lower
versions like so:

if version >= 2.5:
   format = '%(levelname)s %(module)s.%(funcName)s: %(message)s'   
else:
   format = '%(levelname)s %(module)s: %(message)s'   

Original comment by istvan.a...@gmail.com on 14 Jan 2009 at 1:23

GoogleCodeExporter commented 8 years ago
Titus,

It seems we've got this issue taken care of but I'd like to double-check with 
you 
before I close it: is it safe to assume that since tests succeed for all Python 
versions the buildbot support, potential problems signalled in the comments 
have 
been resolved and the issue can be closed?

Original comment by mare...@gmail.com on 5 Jun 2009 at 1:02

GoogleCodeExporter commented 8 years ago
Marek,

I'm not sure how to verify that the logging functionality is working properly; 
all we
know at the moment is that it's not breaking anything.  I also don't know how
important it is to verify this.  If Istvan says it's OK, then I think it's OK.

Original comment by the.good...@gmail.com on 7 Jun 2009 at 3:20

GoogleCodeExporter commented 8 years ago
Logging functionality is partially tested by megatests, as their output parser 
relies on specific output provided by the logger. Given these are run on a 
daily 
basis, I guess the issue can be considered successfully reviewed and closed.

Original comment by mare...@gmail.com on 4 Sep 2009 at 9:01