serialhdl: Make dump_debug() output atomic

Build a single (very large) logging message with the debug state.
This prevents the output from being fragmented.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-09-27 11:54:10 -04:00
parent 6e5bcc69bc
commit 8f8951b4c1
2 changed files with 10 additions and 8 deletions

View file

@ -451,8 +451,8 @@ class MCU:
return
self._is_shutdown = True
self._shutdown_msg = msg = params['#msg']
logging.info("%s: %s", params['#name'], self._shutdown_msg)
self._serial.dump_debug()
logging.info("MCU '%s' %s: %s\n%s", self._name, params['#name'],
self._shutdown_msg, self._serial.dump_debug())
prefix = "MCU '%s' shutdown: " % (self._name,)
if params['#name'] == 'is_shutdown':
prefix = "Previous MCU '%s' shutdown: " % (self._name,)