Add capture parser

This commit adds contrib/message-capture/message-capture-parser.py, a python
script to be used alongside -capturemessages to parse the captured
messages.

It is complete with arguments and will parse any file given, sorting the
messages in the files when creating the output.  If an output file is
specified with -o or --output, it will dump the messages in json format
to that file, otherwise it will print to stdout.

The small change to the unused msg_generic is to bring it in line with
the other message classes, purely to avoid a bug in the future.
This commit is contained in:
Troy Giorshev
2020-07-13 16:07:13 -04:00
parent 4d1a582549
commit e4f378a505
2 changed files with 215 additions and 1 deletions

View File

@@ -1273,7 +1273,7 @@ class msg_block:
# for cases where a user needs tighter control over what is sent over the wire
# note that the user must supply the name of the msgtype, and the data
class msg_generic:
__slots__ = ("msgtype", "data")
__slots__ = ("data")
def __init__(self, msgtype, data=None):
self.msgtype = msgtype