Return matches or None from LogParser iteration
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Wed, 18 May 2022 11:48:50 +0000 (13:48 +0200)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Thu, 19 May 2022 11:20:36 +0000 (13:20 +0200)
commit443534547fe50cab598d6850b2e879a0e9a3ab7b
tree1e61cf4bb500ee8602b54eb4491164bcca33d0e4
parent545f34585342891a42fe6b18a629a21fca27caad
Return matches or None from LogParser iteration

Yielding match-object or string is bad style. Iteration over LogParser now
yields either match-object or None. If None is returned (i.e. parsing line
failed), then the problematic input is saved in LogParser object's attribute
last_unparsed_line (until next matching fails).

To make this work we need to run prepare_result on every single line, so
prepare_result cannot return multiple lines at once. Therefore, made
prepare_result also a generator (which makes more sense, anyway).
src/log_read.py