From 1a537f05e30b494c45f94f12c2d992b1e7dd5eba Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Mon, 25 Apr 2022 14:51:19 +0200 Subject: [PATCH] Fix error in log reader When receiving several lines, the LogParser would only parse and return the first. Fixed that. --- src/log_read.py | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/log_read.py b/src/log_read.py index 1d8bef4..0288dd8 100644 --- a/src/log_read.py +++ b/src/log_read.py @@ -387,10 +387,12 @@ class LogParser(LineReader): :rtype: [(str, :py:class:`re.Match` OR str, int)] """ # let super class split data into lines + result = [] for description, raw_line, idx in \ super(LogParser, self).prepare_result(*args): - result = re.match(self.pattern, raw_line) - if result: - return description, result, idx + matches = re.match(self.pattern, raw_line) + if matches: + result.append((description, matches, idx)) else: - return description, raw_line, idx + result.append((description, raw_line, idx)) + return result -- 1.7.1