Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-7741: Fix missed logging update to lsst.log #22

Merged
merged 2 commits into from
Oct 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin.src/processCalibLsstSim.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@
try:
task.run(sensorDataRefLists[k], type)
except Exception, e:
task.log.log(task.log.FATAL, "Failed on dataId=%s: %s" % (k, e))
task.log.fatal("Failed on dataId=%s: %s", k, e)
traceback.print_exc(file=sys.stderr)
6 changes: 3 additions & 3 deletions python/lsst/obs/lsstSim/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ def run(self, args):
with context as registry:
for infile in filenameList:
if self.isBadFile(infile, args.badFile):
self.log.info("Skipping declared bad file %s" % infile)
self.log.info("Skipping declared bad file %s", infile)
continue
fileInfo, hduInfoList = self.parse.getInfo(infile)
if self.isBadId(fileInfo, args.badId.idList):
self.log.info("Skipping declared bad file %s: %s" % (infile, fileInfo))
self.log.info("Skipping declared bad file %s: %s", infile, fileInfo)
continue
if self.register.check(registry, fileInfo):
self.log.warn("%s: already ingested: %s" % (infile, fileInfo))
self.log.warn("%s: already ingested: %s", infile, fileInfo)
outfile = self.parse.getDestination(args.butler, fileInfo, infile)
self.ingest(infile, outfile, mode=args.mode, dryrun=args.dryrun)
for info in hduInfoList:
Expand Down
6 changes: 3 additions & 3 deletions python/lsst/obs/lsstSim/processCalibLsstSim.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ def run(self, sensorRefList, calibType):
for amp in referenceAmps:
if amp.dataId['snap'] == 1:
continue
self.log.log(self.log.INFO, "Amp: Processing %s" % (amp.dataId))
self.log.info("Amp: Processing %s", amp.dataId)
print "dataid %s"%(amp.dataId)
butler = amp.butlerSubset.butler
ampMIList = afwImage.vectorMaskedImageF()
for sRef in sensorRefList:
self.log.log(self.log.INFO, "Sensor: Processing %s" % (sRef.dataId))
self.log.info("Sensor: Processing %s", sRef.dataId)
ampSnapMIList = afwImage.vectorMaskedImageF()
dataId = eval(amp.dataId.__repr__())
dataId['visit'] = sRef.dataId['visit']
Expand Down Expand Up @@ -200,6 +200,6 @@ def combineMIList(self, miList, method='MEANCLIP'):
else:
raise ValueError("Method %s is not supported for combining frames"%(method))
except Exception as e:
self.log.log(self.log.WARN, "Could not combine the frames. %s" % (e,))
self.log.warn("Could not combine the frames. %s", e)

return combinedFrame
7 changes: 3 additions & 4 deletions python/lsst/obs/lsstSim/selectFluxMag0.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def run(self, dataId):
runArgDict = self.runArgDictFromDataId(dataId)
visit = runArgDict["visit"]
except Exception:
self.log.fatal("dataId does not contain mandatory visit key: dataId: %s"%dataId)
self.log.fatal("dataId does not contain mandatory visit key: dataId: %s", dataId)

if self._display:
self.log.info(self.config.database)
Expand Down Expand Up @@ -127,14 +127,13 @@ def run(self, dataId):
dataTuple += tuple(wd[1] for wd in whereDataList)

if self._display:
self.log.info("queryStr=%r; dataTuple=%s" % (queryStr, dataTuple))
self.log.info("queryStr=%r; dataTuple=%s", queryStr, dataTuple)

cursor.execute(queryStr, dataTuple)
result = cursor.fetchall()
fluxMagInfoList = [FluxMagInfo(r) for r in result]
if self._display:
self.log.info("Found %d exposures" % \
(len(fluxMagInfoList)))
self.log.info("Found %d exposures", len(fluxMagInfoList))

return pipeBase.Struct(
fluxMagInfoList = fluxMagInfoList,
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/obs/lsstSim/selectLsstImages.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def run(self, coordList, filter):

dataTuple = (filter, self.config.maxFwhm)

self.log.info("queryStr=%r; dataTuple=%s" % (queryStr, dataTuple))
self.log.info("queryStr=%r; dataTuple=%s", queryStr, dataTuple)

cursor.execute(queryStr, dataTuple)
exposureInfoList = [ExposureInfo(result) for result in cursor]
Expand Down