mobile_insight.analyzer.msg_logger module

A simple message dumper in stdio and/or file

Author: Yuanjie Li, Zengwen Yuan

class mobile_insight.analyzer.msg_logger.MsgLogger

Bases: mobile_insight.analyzer.analyzer.Analyzer

A simple dumper to print messages

ALL = 6
DICT = 3
FILE_ONLY = 5
JSON = 2
NO_DECODING = 0
STDIO_ONLY = 4
XML = 1
__dump_message(msg)

Print the received message

Parameters

msg – the received message

save_decoded_msg_as(filepath)

Save decoded messages as a plain-text file. If not called, by default MsgLogger will not save decoded results as file.

Parameters

filepath (string) – the path of the file to be saved

set_decode_format(msg_format)

Configure the format of decoded message. If not set, the message will not be decoded

Parameters

msg_format (NO_DECODING, XML, JSON or DICT) – the format of the decoded message

set_decoding(decode_type)

Specify how to decode the messages

Parameters

decode_type (int) – specify how to decode messages. It can be MsgLogger.NO_DECODING, MsgLogger.XML or MsgLogger.JSON

set_dump_type(dump_type)

Specify if dump message to stdio and/or file

Parameters

dump_type (STDIO_ONLY, FILE_ONLY, ALL) – the dump type