forked from p15670423/monkey
Log parser shows error and warning amount
This commit is contained in:
parent
f7dacf0952
commit
cde256e4b9
|
@ -12,8 +12,9 @@ class MonkeyLogParser(object):
|
||||||
return log.read()
|
return log.read()
|
||||||
|
|
||||||
def print_errors(self):
|
def print_errors(self):
|
||||||
print("Errors:")
|
errors = MonkeyLogParser.get_errors(self.log_contents)
|
||||||
for error_line in MonkeyLogParser.get_errors(self.log_contents):
|
print("Found {} errors:".format(len(errors)))
|
||||||
|
for error_line in errors:
|
||||||
print(error_line)
|
print(error_line)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -22,8 +23,9 @@ class MonkeyLogParser(object):
|
||||||
return searcher.findall(log_contents)
|
return searcher.findall(log_contents)
|
||||||
|
|
||||||
def print_warnings(self):
|
def print_warnings(self):
|
||||||
print("Warnings:")
|
warnings = MonkeyLogParser.get_warnings(self.log_contents)
|
||||||
for warning_line in MonkeyLogParser.get_warnings(self.log_contents):
|
print("Found {} warnings:".format(len(warnings)))
|
||||||
|
for warning_line in warnings:
|
||||||
print(warning_line)
|
print(warning_line)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Reference in New Issue