func (c *Client) SetActivities(ctx context.Context, activities []Activity, startOfDay time.Time) error {
if len(activities) == 0 {
+ log.Debugf(ctx, "SetActivities(): len(activities) == 0")
return nil
}
}
if len(dataPoints) == 0 {
+ log.Debugf(ctx, "SetActivities(): len(dataPoints) == 0")
return nil
}
+ log.Debugf(ctx, "SetActivities(): calling c.DatasetPatch(%q)", dataStreamID)
return c.DatasetPatch(ctx, dataStreamID, dataPoints)
}
if err != nil {
return err
}
+ log.Debugf(ctx, "fitbitClient.Sleep(%v) returned %d sleep stages", tm, len(sleep.Stages))
var activities []gfit.Activity
for _, stg := range sleep.Stages {
return gfitErr
}
+ log.Debugf(ctx, "passing %d activities to gfitClient.SetActivities()", len(activities))
if err := gfitClient.SetActivities(ctx, activities, tm); err != nil {
return fmt.Errorf("SetActivities() = %v", err)
}