Skip to content

Commit

Permalink
Corrected logging per review.
Browse files Browse the repository at this point in the history
Change-Id: Iead7f1e76296a5b69c99f25b3d868a1d853562a9
  • Loading branch information
danmergens committed Dec 12, 2018
1 parent 2d40174 commit d640c38
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mi/core/instrument/dataset_data_particle.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,19 +361,19 @@ def _encode_value(self, name, value, encoding_function, value_range=None):

if encoding_function in [int, float]:
if vmin and encoded_val < vmin:
log.error('Particle value (%s) below minimum threshold (%s < %s). Value', name, value, vmin)
log.error('Particle value (%s) below minimum threshold (%s < %s)', name, value, vmin)
self._encoding_errors.append({name: value})
elif vmax and encoded_val > vmax:
log.error('Particle value (%s) exceeds maximum threshold (%s > %s). Value', name, value, vmax)
log.error('Particle value (%s) exceeds maximum threshold (%s > %s)', name, value, vmax)
self._encoding_errors.append({name: value})
elif hasattr(encoded_val, '__len__'):
try:
if vmin and len(encoded_val) < vmin:
log.error('Particle value (%s) length below minimum threshold (%s < %s). Value',
log.error('Particle value (%s) length below minimum threshold (%s < %s)',
name, value, vmin)
self._encoding_errors.append({name: value})
elif vmax and len(encoded_val) > vmax:
log.error('Particle value (%s) length exceeds maximum threshold (%s > %s). Value',
log.error('Particle value (%s) length exceeds maximum threshold (%s > %s)',
name, value, vmax)
self._encoding_errors.append({name: value})
# in the unlikely event that a range was specified and the encoding object created a bogus len()
Expand Down

0 comments on commit d640c38

Please sign in to comment.