Skip to content

Commit

Permalink
remove dodgy behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
redmoogle committed May 18, 2024
1 parent 86386dc commit 956f9cf
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Tools/clean_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
warning_pattern = re.compile(r'##\[warning\].*') # catch warnings might want to catch errors?

for log_file in log_files:
with open(log_file, 'w+') as log:
for line in log:
with open(log_file, 'r') as log_in:
lines = log_in.readlines()
with open(log_file, 'w') as log_out:
for line in lines:
if warning_pattern.search(line):
if line not in seen:
seen.add(line)
log.write(line)
else:
log.write(line)
log_out.write(line)
continue
log_out.write(line)

0 comments on commit 956f9cf

Please sign in to comment.