Skip to content

Commit 14d24b1

Browse files
ksstmscfriedt
authored andcommitted
script: logging: fix formatting of dropped messages
Print the actual number instead of a single-element tuple. For example: "2 messages dropped" instead of "(2,) messages dropped" Signed-off-by: Tamás Kiss <[email protected]>
1 parent 26afb52 commit 14d24b1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

scripts/logging/dictionary/dictionary_parser/log_parser_v1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def parse_one_msg(self, logdata, offset):
366366
return False, offset
367367
offset += struct.calcsize(self.fmt_msg_type)
368368

369-
num_dropped = struct.unpack_from(self.fmt_dropped_cnt, logdata, offset)
369+
num_dropped = struct.unpack_from(self.fmt_dropped_cnt, logdata, offset)[0]
370370
offset += struct.calcsize(self.fmt_dropped_cnt)
371371

372372
print(f"--- {num_dropped} messages dropped ---")

scripts/logging/dictionary/dictionary_parser/log_parser_v3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ def parse_one_msg(self, logdata, offset):
378378

379379
offset += struct.calcsize(self.fmt_msg_type)
380380

381-
num_dropped = struct.unpack_from(self.fmt_dropped_cnt, logdata, offset)
381+
num_dropped = struct.unpack_from(self.fmt_dropped_cnt, logdata, offset)[0]
382382
offset += struct.calcsize(self.fmt_dropped_cnt)
383383

384384
print(f"--- {num_dropped} messages dropped ---")

0 commit comments

Comments
 (0)