-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
error and warning tracker (separate) #17
Conversation
ersilia/core/tracking.py
Outdated
@@ -27,6 +44,7 @@ def write_persistent_file(contents): | |||
with open(PERSISTENT_FILE_PATH, "a") as f: | |||
f.write(f"{contents}\n") | |||
|
|||
log_files_metrics(TEMP_FILE_LOGS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you actually move this into close_persistent_file
instead? I know I said it should be in this method, but I think it makes more sense to only run when we're closing the file instead.
ersilia/core/tracking.py
Outdated
|
||
with open(file, "r") as file: | ||
for line in file: | ||
if "ERROR" in line: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a reminder to update this so it only checks if "ERROR" is at the beginning of the line.
ersilia/core/tracking.py
Outdated
elif "WARNING" in line: | ||
warning_count += 1 | ||
|
||
print(f"Error count: {error_count}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you swap out print
with write_persistent_file
instead?
Added the log_files_metrics function that keeps track of the error and warnings in the log files separately and prints the results.