Skip to content

Commit

Permalink
Merge pull request #47 from lsst/tickets/DM-8159
Browse files Browse the repository at this point in the history
Make time/resource metadata explicitly LongLong.
  • Loading branch information
ktlim committed Apr 5, 2018
2 parents 8dc27d3 + c6fbefd commit a695220
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/lsst/pipe/base/timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ def logPairs(obj, pairs, logLevel=Log.DEBUG):
- ``log`` an instance of `lsst.log.Log`.
pairs : sequence
A sequence of ``(name, value)`` pairs.
A sequence of ``(name, value)`` pairs, with value typically numeric.
logLevel : optional
Log level (an `lsst.log` level constant, such as `lsst.log.Log.DEBUG`).
"""
strList = []
for name, value in pairs:
try:
# Use LongLong explicitly here in case an early value in the sequence is int-sized
obj.metadata.addLongLong(name, value)
except TypeError as e:
obj.metadata.add(name, value)
except Exception as e:
obj.log.fatal("%s.metadata.add(name=%r, value=%r) failed with error=%s",
type(obj).__name__, name, value, e)
strList.append("%s=%s" % (name, value))
log(obj.log.getName(), logLevel, "; ".join(strList))

Expand Down

0 comments on commit a695220

Please sign in to comment.