adding logging
This commit is contained in:
@@ -417,6 +417,13 @@ def add(x, y): # pragma: no cover
|
||||
def handle_c2_sync(workoutid, url, headers, data, debug=False, **kwargs):
|
||||
response = requests.post(url, headers=headers, data=data)
|
||||
if response.status_code not in [200, 201]: # pragma: no cover
|
||||
s = 'C2 upload failed for user workoutid {workoutid} with response code {code} and error {text}'.format(
|
||||
code=response.status_code,
|
||||
workoutid = workoutid,
|
||||
text = response.text
|
||||
|
||||
)
|
||||
dologging('c2_log.log',s)
|
||||
return 0
|
||||
|
||||
s = response.json()
|
||||
|
||||
Reference in New Issue
Block a user