Skip to content

Commit

Permalink
Use trace for debug logging more verbose than debug
Browse files Browse the repository at this point in the history
Based on this commit: 4f0d38a
the records logged at pex.logging debug(2) are meant to be
logged to a level more verbose than a typical debug level,
hence they are logged to TRACE with lsst.log.
  • Loading branch information
Hsin-Fang Chiang committed Sep 1, 2016
1 parent 6f3e80e commit e078dd7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions python/lsst/meas/algorithms/objectSizeStarSelector.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
pyplot = None

from lsst.afw.table import SourceCatalog
from lsst.log import Log
from lsst.pipe.base import Struct
from lsst.afw.cameraGeom import TAN_PIXELS
from lsst.afw.geom.ellipses import Quadrupole
import lsst.afw.geom as afwGeom
import lsst.pex.config as pexConfig
import lsst.pex.logging as log
import lsst.afw.display.ds9 as ds9
from .starSelector import BaseStarSelectorTask, starSelectorRegistry

Expand Down Expand Up @@ -140,7 +140,8 @@ def _assignClusters(yvec, centers):
minDist = numpy.nan*numpy.ones_like(yvec)
clusterId = numpy.empty_like(yvec)
clusterId.dtype = int # zeros_like(..., dtype=int) isn't in numpy 1.5
dbl = log.Debug("objectSizeStarSelector._assignClusters", 0)
dbl = Log.getLogger("objectSizeStarSelector._assignClusters")
dbl.setLevel(dbl.INFO)

# Make sure we are logging aall numpy warnings...
oldSettings = numpy.seterr(all="warn")
Expand All @@ -153,7 +154,7 @@ def _assignClusters(yvec, centers):
else:
update = dist < minDist
if w: # Only do if w is not empty i.e. contains a warning message
dbl.debug(2, str(w[-1]))
dbl.trace(str(w[-1]))

minDist[update] = dist[update]
clusterId[update] = i
Expand Down

0 comments on commit e078dd7

Please sign in to comment.