Debugging in Py

*nixtechno epctechno at gmail.com
Wed Mar 25 17:25:57 EDT 2009


Big thanks tkc, and I was wondering what your thoughts are on logging
module: http://docs.python.org/library/logging.html

"Instead of using many print statements for debugging, use
logger.debug: Unlike the print statements, which you will have to
delete or comment out later, the logger.debug statements can remain
intact in the source code and remain dormant until you need them
again. At that time, the only change that needs to happen is to modify
the severity level of the logger and/or handler to debug."

Where it makes sense as they state using this rather than printing,
due to the fact that you don't have to strip it all out when it's time
to release your work... I seen some writing on pdb, but I guess it's
time to study up on it. I appreciate the help.



More information about the Python-list mailing list