def loglines(self):
for l in self.fd:
e = ENTRY_REGEX.match(l)
- if e is None:
- raise ValueError("Invalid log line:", l)
- yield e.groupdict()
+ if e is not None:
+ yield e.groupdict()
if __name__ == '__main__':
def loglines(self):
for l in self.fd:
e = ENTRY_REGEX.match(l)
- if e is None:
- raise ValueError("Invalid log line:", l)
- yield e.groupdict()
+ if e is not None:
+ yield e.groupdict()
if __name__ == '__main__':
def loglines(self):
for l in self.fd:
- yield LogEntry(l)
+ try:
+ yield LogEntry(l)
+ except ValueError:
+ pass # ignore invalid lines
class BlockList: