diff --git a/starfields_logparser/base_parsers.py b/starfields_logparser/base_parsers.py index e2070d2..d68ea95 100644 --- a/starfields_logparser/base_parsers.py +++ b/starfields_logparser/base_parsers.py @@ -18,6 +18,7 @@ class BaseOrderedLogParser: line = file.readline() new_flag = False + break_condition = True while (line): # Only check for a new line if we're not at new entries yet if not new_flag: @@ -34,7 +35,10 @@ class BaseOrderedLogParser: self.aggregators_deinit(file, aggregates, status) - self.update_status(aggregates, status) + if not break_condition: + self.reset_status(aggregates, status) + else: + self.update_status(aggregates, status) def get_context_manager(self): """ @@ -52,6 +56,12 @@ class BaseOrderedLogParser: """ pass + def reset_status(self, aggregates, status): + """ + Resets the saved status of the parser. + """ + pass + def update_status(self, aggregates, status): """ Updates the saved status of the parser.