log2zulip: Remove unnecessary loop and fix incorrect variable name.
MODIFY
zulip/integrations/log2zulip/log2zulip
zulip/integrations/log2zulip/log2zulip
@@ -66,7 +66,6 @@ def process_lines(raw_lines, file_name):
def process_logs():
# type: () -> None
- for filename in log_files:
data_file_path = os.path.join(temp_dir, "log2zulip.state")
mkdir_p(os.path.dirname(data_file_path))
if not os.path.exists(data_file_path):
@@ -91,7 +90,7 @@ def process_logs():
output = subprocess.check_output(["tail", "-n+%s" % (file_data["last"],), log_file])
new_lines = output.decode('utf-8', errors='replace').split('\n')[:-1]
if len(new_lines) > 0:
- process_lines(new_lines, filename)
+ process_lines(new_lines, log_file)
file_data["last"] += len(new_lines)
new_data[log_file] = file_data
open(data_file_path, "w").write(json.dumps(new_data))

log2zulip: Remove unnecessary loop and fix incorrect variable name.