|
|
@@ -25,7 +25,7 @@ def check_log_file(log_file, error_msg, last_line_file):
|
|
|
last_line_read = 0
|
|
|
if os.path.exists(last_line_file):
|
|
|
with open(last_line_file, "r") as f:
|
|
|
- last_line_read = int(f.readline().strip())
|
|
|
+ last_line_read = int(f.readline().strip())
|
|
|
|
|
|
with open(log_file, "r") as f:
|
|
|
log_lines = f.readlines()
|
|
|
@@ -37,7 +37,7 @@ def check_log_file(log_file, error_msg, last_line_file):
|
|
|
for i, line in enumerate(log_lines[last_line_read:]):
|
|
|
if re.search(error_msg, line):
|
|
|
with open(last_line_file, "w") as f:
|
|
|
- f.write(str(last_line_read + i))
|
|
|
+ f.write(str(last_line_read + i + 1))
|
|
|
return True
|
|
|
with open(last_line_file, "w") as f:
|
|
|
f.write(str(len(log_lines)))
|