From 7c2094dc443710d5de2e36c2d8c78d8165b72903 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Sun, 27 Mar 2022 22:20:19 +0300 Subject: [PATCH] DbgMuxPeer: use %03u for logging Rx/Tx counter values This makes the header length consistent in logging messages. --- peer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/peer.py b/peer.py index 1c850d1..c1c78f8 100644 --- a/peer.py +++ b/peer.py @@ -51,7 +51,7 @@ class DbgMuxPeer: frame = DbgMuxFrame.Frame.build(c)[:-2] # strip b'\x00\x00' c['FCS'] = DbgMuxFrame.fcs_func(frame) - log.debug('Tx frame (Ns=%d, Nr=%d, fcs=0x%04x) %s %s', + log.debug('Tx frame (Ns=%03u, Nr=%03u, fcs=0x%04x) %s %s', c['TxCount'], c['RxCount'], c['FCS'], c['MsgType'], c['MsgData'].hex()) @@ -64,7 +64,7 @@ class DbgMuxPeer: def recv(self) -> Container: c = DbgMuxFrame.Frame.parse_stream(self._sl) - log.debug('Rx frame (Ns=%d, Nr=%d, fcs=0x%04x) %s %s', + log.debug('Rx frame (Ns=%03u, Nr=%03u, fcs=0x%04x) %s %s', c['TxCount'], c['RxCount'], c['FCS'], c['MsgType'], c['MsgData'].hex())