From: Kim Gunsoo Date: Fri, 15 Apr 2016 05:25:20 +0000 (+0900) Subject: Modify the push/pull log stream to stdout X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=95e055248c690d4e66db7856a8a5630669d2d92a;p=sdk%2Ftools%2Fsdb.git Modify the push/pull log stream to stdout - In the case of normal behavior for file push/pull, the output to stdout. Change-Id: I96cd0c1693e032b85e62c9ccba5b87cfd6226ec9 Signed-off-by: Kim Gunsoo --- diff --git a/src/file_sync_client.c b/src/file_sync_client.c index 85d98b7..741f96a 100644 --- a/src/file_sync_client.c +++ b/src/file_sync_client.c @@ -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);