Sentry logging

Logging for my Sentry server that tracks the values of the serial number, car fingerprint, user set parameters, and the date and time for when FrogPilot was installed and last updated for debugging and support.
This commit is contained in:
FrogAi
2024-02-27 16:34:47 -07:00
parent bb61ac62a7
commit 6427b1380e
5 changed files with 137 additions and 17 deletions

View File

@@ -31,6 +31,10 @@ from openpilot.selfdrive.frogpilot.functions.frogpilot_functions import DEFAULT_
def manager_init() -> None:
save_bootlog()
# Clear the error log on boot to prevent old errors from hanging around
if os.path.isfile(os.path.join(sentry.CRASHES_DIR, 'error.txt')):
os.remove(os.path.join(sentry.CRASHES_DIR, 'error.txt'))
params = Params()
params_storage = Params("/persist/comma/params")
params.clear_all(ParamKeyType.CLEAR_ON_MANAGER_START)
@@ -387,6 +391,10 @@ def manager_thread() -> None:
elif not started and started_prev:
params.clear_all(ParamKeyType.CLEAR_ON_OFFROAD_TRANSITION)
# Clear the error log on offroad transition to prevent old errors from hanging around
if os.path.isfile(os.path.join(sentry.CRASHES_DIR, 'error.txt')):
os.remove(os.path.join(sentry.CRASHES_DIR, 'error.txt'))
# update onroad params, which drives boardd's safety setter thread
if started != started_prev:
write_onroad_params(started, params)