[chirp_devel] debug logging function?
Wonder if there is a global debug logging function. If not, is it a good idea, and if so, where should we put it?
I was thinking of adding a function such as logdebug (or DEBUG, debug, etc?) in chirp_common.py that takes care of this, so that:
import os … if os.getenv("CHIRP_DEBUG"):
print "foo: %i, %s" % (var1, var2)
could become something like:
from chirp_common import logdebug … logdebug("foo: %i, %s" % (var1, var2))
Im guessing it should take standard print formats? Ideas/thoughts from pygurus on best practice for this?
-Jens
Ideas/thoughts from pygurus on best practice for this?
We should be using the Python logging module. I've often set out to clean it all up and move to that, but decide against the mountain of work :)
That would let us identify log levels, the source of a message, etc, and is The Way(tm) to do it in Python.
--Dan
participants (2)
-
Dan Smith
-
Jens J.