Private
Public Access
1
0

adding strava logging to analyze errors

This commit is contained in:
Sander Roosendaal
2020-05-18 20:02:09 +02:00
parent 5b9cdc1336
commit 4d260ab8e6
2 changed files with 38 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ import yamllint
from subprocess import call
import re
import sys
import time
from verbalexpressions import VerEx
@@ -551,6 +552,15 @@ def do_sync(w,options, quick=False):
except NoTokenError:
id = 0
message = "Please connect to Strava first"
except:
e = sys.exc_info()[0]
t = time.localtime()
timestamp = time.strftime('%b-%d-%Y_%H%M', t)
with open('stravalog.log','a') as f:
f.write('\n')
f.write(timestamp)
f.write(str(e))
if ('upload_to_SportTracks' in options and options['upload_to_SportTracks']) or (w.user.sporttracks_auto_export and ispromember(w.user.user)):