Sentry: Log error in Error Troubleshoot with only last 3 lines

This commit is contained in:
Jason Wen
2023-11-12 06:34:10 +00:00
parent bce0dc3efa
commit 4afb19c97e
+5 -1
View File
@@ -58,7 +58,11 @@ def save_exception(exc_text):
for file in files:
with open(file, 'w') as f:
f.write(exc_text)
if file.endswith("error.txt"):
lines = exc_text.splitlines()[-3:]
f.write("\n".join(lines))
else:
f.write(exc_text)
print('Logged current crash to {}'.format(files))