mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-07-12 13:42:07 +08:00
Sentry: Log error in Error Troubleshoot with only last 3 lines
This commit is contained in:
+5
-1
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user