class DownstreamSendO32BasketOrderParser(Parser):
keyword = 'Send o32 stock Basket request'
pattern_string = r'(\d+-\d+-\d+T\d+:\d+:\d+,\d+)'
items_name = ("timestamp", )
def parse_next_lines(self, line_iterator):
line_func_id = next(line_iterator) # skip
line_headers = next(line_iterator)
# line_data = next(line_iterator)
headers = [k.strip('"') for k in line_headers.split(',')]
self.data[-1]['stocks'] = []
log_parser.add_line_parsers(DownstreamSendO32BasketOrderParser)
log_parser也是一个类
log_parser类的add_line_parsers方法的定义是怎样的?它可能是要把DownstreamSendO32BasketOrderParser的名称写入到日志或直接实例化一个对象