# split_logs.py def split_logs(input_file): modules = { "resize1": [], "png2bmp1": [], "lpd_wasm1": [], "cifar10_1": [], "work1": [] } with open(input_file, 'r') as f: for line in f: for module in modules.keys(): if module in line: modules[module].append(line.strip()) break for module, entries in modules.items(): with open(f"{module}.txt", 'w') as outfile: outfile.write("\n".join(entries) + "\n") if __name__ == "__main__": split_logs("sledge.log")