Skip to content

Commit

Permalink
Issue #78 - Include timestamp in out of limit notification
Browse files Browse the repository at this point in the history
  • Loading branch information
MJJoyce committed Jul 12, 2018
1 parent 7455ef2 commit fbcb8b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ait/gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,13 @@ def telem_handler(session):
for field, defn in limit_dict[packet.name].iteritems():
v = decoded._getattr(field)
if defn.error(v):
msg = 'Field {} error out of limit with value {}'.format(field, v)
msg = 'Field {} error out of limit at {} with value {}'.format(
field, datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%SZ"), v)
log.error(msg)
notify.trigger_notification('limit-error', msg)
elif defn.warn(v):
msg = 'Field {} warning out of limit with value {}'.format(field, v)
msg = 'Field {} warning out of limit at {} with value {}'.format(
field, datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%SZ"), v)
log.warn(msg)
notify.trigger_notification('limit-warn', msg)

Expand Down

0 comments on commit fbcb8b6

Please sign in to comment.