Closed adeutscher closed 10 years ago
While we're at it, we should also change the print statements to use the logging module.
Recently read http://blog.tplus1.com/blog/2007/09/28/the-python-logging-module-is-much-better-than-print-statements/ (Thanks Reddit!), and the sample in this blog post is enough to make me swear off using print statements for the most part.
Notes:
printDebug
, so implementing this should be fairly easy to implement.secrecyLevel
argument to printDebug
. I could just use the levels as a control for which function to call (e.g. logging.exception() vs. logging.debug() ), and let logging
manage access control.Switched logging over to using Python's logging module.
Added a method to help people unfamiliar with the module to enable stdout, but choosing further logging destinations will be the user's responsibility.
I need to think up a better description for the debug levels than "debug level X", and adjust the printDebug calls accordingly.