LSST Applications 23.0.4,g037fbe16b5+d85c0663ba,g096abc94f8+6a48825234,g103fe59d6f+e9dde1d5b6,g15c806e14d+8faf99ddd7,g32debb59f0+e66c719481,g496fd5de66+3fe553d53f,g4a4ce7fc1d+ece16c4446,g4a6547c0d5+eb80ac6072,g59f966b972+a23df0c0d7,g5f9a1bc040+398a21f15a,g5fe48ebfad+e469c1f7ea,g6e05de7fdc+c1283a92b8,g72cdda8301+e9dde1d5b6,g7d6de66fda+e66c719481,g7f82c8f19b+c75af4a55f,g849a1b8b7e+9cdeb6bdb3,g87000a63fb+c77d247713,g8d527e0710+82ca1435d2,g8e32f31f9f+ece16c4446,g8ef0a89dcb+e66c719481,g92698f76a1+c75af4a55f,g9c3108eb99+a5490437c9,ga9b0f51b18+052faf71bd,gaaec9c0f9d+dfef2b6997,gaf95d0f0f9+e66c719481,gb66926d50d+ece16c4446,gba73697911+8faf99ddd7,gbdffd78dd5+8f24e8bc9d,gc6753737fe+ece16c4446,gcb770ba17b+f2d6553a10,gd00fb1e517+ad367c4392,gd060f87c5c+cced0e9966,gd90a20c951+052faf71bd,gde069b70e5+7589c3a021,gee0fe1808a+052faf71bd,gf6ad1f1eeb+f5c5fcf7b5,gfc62afb072+ece16c4446
LSST Data Management Base Package
Loading...
Searching...
No Matches
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.

You may interrogate lsstDebug for any string in sys.modules, i.e. for the __name__ of any package that has been imported; for example, if the Robert.Hugh.Lupton package is loaded then lsstDebug.Info("Robert.Hugh.Lupton").parameter will return False for any named parameter that has not already been set to True elsewhere.

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
table::Key< std::string > name
Definition: Amplifier.cc:116
table::Key< int > b

into a file debug.py available in the PYTHONPATH 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