LSSTApplications  17.0+11,17.0+35,17.0+59,17.0+60,17.0+62,17.0+7,17.0-1-g377950a+35,17.0.1-1-g114240f+2,17.0.1-1-g4d4fbc4+30,17.0.1-1-g55520dc+53,17.0.1-1-g5f4ed7e+57,17.0.1-1-g6dd7d69+21,17.0.1-1-g8de6c91+11,17.0.1-1-gb9095d2+7,17.0.1-1-ge9fec5e+5,17.0.1-1-gf4e0155+61,17.0.1-1-gfc65f5f+55,17.0.1-1-gfc6fb1f+20,17.0.1-10-g87f9f3f+7,17.0.1-12-g112a4bc+1,17.0.1-17-gab9750a3+3,17.0.1-17-gdae4c4a+14,17.0.1-19-g3a24bb2,17.0.1-2-g26618f5+34,17.0.1-2-g54f2ebc+9,17.0.1-2-gf403422+1,17.0.1-21-g52a398f+3,17.0.1-25-gd5522830,17.0.1-3-g7e86b59+44,17.0.1-3-gb5ca14a,17.0.1-3-gd08d533+45,17.0.1-31-gb0791f330,17.0.1-4-g59d126d+8,17.0.1-5-g3877d06,17.0.1-7-g35889ee+5,17.0.1-7-gc7c8782+20,17.0.1-7-gcb7da53+3,17.0.1-9-gc4bbfb2+8,v18.0.0.rc1
LSSTDataManagementBasePackage
Using lsstDebug to control debugging output

The class lsstDebug can be used to turn on debugging output in a non-intrusive way.

For example, the variable lsstDebug.Info("lsst.meas.astrom.astrom").debug is used to control debugging output from the lsst.meas.astrom.astrom module.

It is always safe to interrogate lsstDebug; for example lsstDebug.Info("Robert.Hugh.Lupton").isBadPerson will return False.

The convention is that the name ("lsst.meas.astrom.astrom") is the __name__ of the module, so the source code will typically look something like:

import lsstDebug
print lsstDebug.Info(__name__).display

which will print False unless lsstDebug.Info(__name__).display has somehow been set to True.

Why is this interesting? Because you can replace lsstDebug.Info with your own version, e.g. if you put

import lsstDebug
def DebugInfo(name):
di = lsstDebug.getInfo(name) # N.b. lsstDebug.Info(name) would call us recursively
if name == "foo":
di.display = True
return di
lsstDebug.Info = DebugInfo

into a file debug.py and

import lsstDebug
print "display is", lsstDebug.Info(__name__).display

into foo.py, then

$ python -c "import foo"
display is False

but

$ python -c "import debug; import foo"
display is True

The command line task interface supports a flag –debug to import debug.py from your PYTHONPATH