logging for c2 import
This commit is contained in:
@@ -160,7 +160,9 @@ def get_c2_workouts(rower):
|
||||
try:
|
||||
thetoken = c2_open(rower.user)
|
||||
except NoTokenError:
|
||||
return 0
|
||||
with open('c2_auto_import.log','a') as logfile:
|
||||
logfile.write('c2_open fail \n')
|
||||
return 0
|
||||
|
||||
res = get_c2_workout_list(rower.user,page=1)
|
||||
|
||||
@@ -185,8 +187,14 @@ def get_c2_workouts(rower):
|
||||
newids = [c2id for c2id in c2ids if not c2id in knownc2ids]
|
||||
|
||||
for c2id in newids:
|
||||
with open('c2_auto_import.log','a') as logfile:
|
||||
logfile.write('Creating async workout for c2id {c2id}\n'.format(c2id=c2id))
|
||||
|
||||
workoutid = create_async_workout(alldata,
|
||||
rower.user,c2id)
|
||||
with open('c2_auto_import.log','a') as logfile:
|
||||
logfile.write('Local workout id {workoutid}\n'.format(workoutid=workoutid))
|
||||
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user