Modify the push/pull log stream to stdout
authorKim Gunsoo <gunsoo83.kim@samsung.com>
Fri, 15 Apr 2016 05:25:20 +0000 (14:25 +0900)
committerKim Gunsoo <gunsoo83.kim@samsung.com>
Fri, 15 Apr 2016 05:34:19 +0000 (14:34 +0900)
- In the case of normal behavior for file push/pull,
  the output to stdout.

Change-Id: I96cd0c1693e032b85e62c9ccba5b87cfd6226ec9
Signed-off-by: Kim Gunsoo <gunsoo83.kim@samsung.com>
src/file_sync_client.c

index 85d98b7ac498c90ab7d9b9cbb7cf4dd264f69541..741f96a05e5491e055527aaee70eb1aa731d5975 100644 (file)
@@ -178,15 +178,15 @@ void print_progress(int stage) {
     percent = calc_progress_percent(progress_bytes);
 
     //TODO: consider current window size.
-    fprintf(stderr,"\r%s %30s\t%3d%%\t%7d%s\t%5dKB/s", g_prg_info.tag, g_prg_info.file_name,
+    fprintf(stdout,"\r%s %30s\t%3d%%\t%7d%s\t%5dKB/s", g_prg_info.tag, g_prg_info.file_name,
                 percent, (progress_bytes/g_prg_info.flag_size), g_prg_info.byte_flag, speed);
-    fflush(stderr);
+    fflush(stdout);
 
     if (stage == SDB_PROGRESS_STAGE_STARTED) {
         init_sync_progress_timer();
     } else if (stage == SDB_PROGRESS_STAGE_FINISHED) {
         deinit_sync_progress_timer();
-        fprintf(stderr,"\n");
+        fprintf(stdout,"\n");
     }
 }
 
@@ -412,7 +412,7 @@ int do_sync_copy(char* srcp, char* dstp, SYNC_INFO* sync_info, int is_utf8) {
             COPY_INFO* _info = (COPY_INFO*)dir_list->data;
 
             if(srcF->get_dirlist(src_fd, _info->src, _info->dst, &entry_list, sync_info)) {
-                fprintf(stderr,"skipped: %s -> %s\n", _info->src, _info->dst);
+                fprintf(stdout,"skipped: %s -> %s\n", _info->src, _info->dst);
                 sync_info->skipped++;
                 free_list(entry_list, NULL);
                 remove_first(&dir_list, free_copyinfo);
@@ -447,7 +447,7 @@ int do_sync_copy(char* srcp, char* dstp, SYNC_INFO* sync_info, int is_utf8) {
                     }
                 }
 skip_in:
-                fprintf(stderr,"skipped: %s -> %s\n", src_p, dst_p);
+                fprintf(stdout,"skipped: %s -> %s\n", src_p, dst_p);
                 sync_info->skipped++;
                 SAFE_FREE(copy_info);
                 SAFE_FREE(src_p);
@@ -457,13 +457,13 @@ skip_in:
         }
     }
 
-    fprintf(stderr,"%d file(s) %s. %d file(s) skipped.\n",
+    fprintf(stdout,"%d file(s) %s. %d file(s) skipped.\n",
             sync_info->copied, sync_info->tag, sync_info->skipped);
 
     long long end_time = NOW() - start_time;
 
     if(end_time != 0) {
-        fprintf(stderr,"%-30s   %lldKB/s (%lld bytes in %lld.%03llds)\n",
+        fprintf(stdout,"%-30s   %lldKB/s (%lld bytes in %lld.%03llds)\n",
                 srcp,
                 ((((long long) sync_info->total_bytes) * 1000000LL) / end_time) / 1024LL,
                 (long long) sync_info->total_bytes, (end_time / 1000000LL), (end_time % 1000000LL) / 1000LL);