Print uploaded files in verbose mode (#520)
* Print uploaded files in verbose and JSON mode
This logs the uploaded directories and files in the verbose mode (`-v`)
similar to logging the downloaded directories and files (however that
doesn't require the verbose mode).
Fixes #519.
diff --git a/src/ios-deploy/ios-deploy.m b/src/ios-deploy/ios-deploy.m
index d235791..ea48f2b 100644
--- a/src/ios-deploy/ios-deploy.m
+++ b/src/ios-deploy/ios-deploy.m
@@ -1948,6 +1948,10 @@
check_error(AFCDirectoryCreate(afc_conn_p, [dirpath fileSystemRepresentation]));
}
+ NSLogVerbose(@"%@", destinationPath);
+ NSLogJSON(@{@"Event": @"UploadFile",
+ @"Destination": destinationPath
+ });
int ret = AFCFileRefOpen(afc_conn_p, [destinationPath fileSystemRepresentation], 3, &file_ref);
if (ret == 0x000a) {
@@ -1974,6 +1978,11 @@
[[NSFileManager defaultManager] fileExistsAtPath: sourcePath isDirectory: &isDir];
if (isDir)
{
+ NSString *dirDestinationPath = [destinationPath stringByAppendingString:@"/"];
+ NSLogVerbose(@"%@", dirDestinationPath);
+ NSLogJSON(@{@"Event": @"UploadDir",
+ @"Destination": dirDestinationPath
+ });
upload_dir(device, afc_conn_p, sourcePath, destinationPath);
}
else