More profile logging

// FREEBIE
pull/1/head
Michael Kirk 8 years ago
parent 3d5836a768
commit 5d58f43837

@ -360,11 +360,15 @@ const NSUInteger kOWSProfileManager_MaxAvatarDiameter = 640;
{ {
// Ensure that the success and failure blocks are called on the main thread. // Ensure that the success and failure blocks are called on the main thread.
void (^failureBlock)() = ^{ void (^failureBlock)() = ^{
DDLogError(@"%@ Updating service with profile failed.", self.tag);
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
failureBlockParameter(); failureBlockParameter();
}); });
}; };
void (^successBlock)() = ^{ void (^successBlock)() = ^{
DDLogInfo(@"%@ Successfully updated service with profile.", self.tag);
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
successBlockParameter(); successBlockParameter();
}); });
@ -615,8 +619,8 @@ const NSUInteger kOWSProfileManager_MaxAvatarDiameter = 640;
}; };
// We have to build up the form manually vs. simply passing in a paramaters dict // We have to build up the form manually vs. simply passing in a paramaters dict
// because AWS is sensitive to the order of the order of the form params (at least // because AWS is sensitive to the order of the form params (at least the "key"
// the "key" field must occur early on). // field must occur early on).
// For consistency, all fields are ordered here in a known working order. // For consistency, all fields are ordered here in a known working order.
[formData appendPartWithFormData:formDataForString(formKey) name:@"key"]; [formData appendPartWithFormData:formDataForString(formKey) name:@"key"];
[formData appendPartWithFormData:formDataForString(formAcl) name:@"acl"]; [formData appendPartWithFormData:formDataForString(formAcl) name:@"acl"];
@ -638,11 +642,11 @@ const NSUInteger kOWSProfileManager_MaxAvatarDiameter = 640;
@"%@ avatar upload progress: %.2f%%", self.tag, uploadProgress.fractionCompleted * 100); @"%@ avatar upload progress: %.2f%%", self.tag, uploadProgress.fractionCompleted * 100);
} }
success:^(NSURLSessionDataTask *_Nonnull uploadTask, id _Nullable responseObject) { success:^(NSURLSessionDataTask *_Nonnull uploadTask, id _Nullable responseObject) {
DDLogDebug(@"%@ successfully uploaded avatar with key: %@", self.tag, formKey); DDLogInfo(@"%@ successfully uploaded avatar with key: %@", self.tag, formKey);
successBlock(formKey); successBlock(formKey);
} }
failure:^(NSURLSessionDataTask *_Nullable uploadTask, NSError *_Nonnull error) { failure:^(NSURLSessionDataTask *_Nullable uploadTask, NSError *_Nonnull error) {
DDLogVerbose(@"%@ uploading avatar failed with error: %@", self.tag, error); DDLogError(@"%@ uploading avatar failed with error: %@", self.tag, error);
failureBlock(); failureBlock();
}]; }];
} }

Loading…
Cancel
Save