Skip to content

Commit

Permalink
Merge pull request #37 from fmessmer/fix/exception_logging
Browse files Browse the repository at this point in the history
Fix/exception logging
  • Loading branch information
fmessmer authored May 16, 2024
2 parents 91921dd + 55f4402 commit 797ae6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions flexbe_core/src/flexbe_core/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def log_throttle(period, text, severity):
# only log when it's the first time or period time has passed for the logging message
if not log_id in Logger._last_logged.keys() or \
rospy.Time.now().to_sec() - Logger._last_logged[log_id].to_sec() > period:
Logger.log(text, severity)
Logger._last_logged.update({log_id: rospy.Time.now()})
Logger.log(text, severity)
Logger._last_logged.update({log_id: rospy.Time.now()})

@staticmethod
def local(text, severity):
Expand Down
2 changes: 1 addition & 1 deletion flexbe_onboard/src/flexbe_onboard/flexbe_onboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def _behavior_execution(self, msg):
self._pub.publish(self.status_topic, BEStatus(behavior_id=msg.behavior_checksum, code=BEStatus.FAILED))
Logger.logerr('Behavior execution failed!\n%s' % str(e))
import traceback
Logger.loginfo(traceback.format_exc())
Logger.loginfo('Traceback:\n' % str(traceback.format_exc()))
result = result if result is not None else "exception" # only set result if not executed

# done, remove left-overs like the temporary behavior file
Expand Down

0 comments on commit 797ae6b

Please sign in to comment.