diff --git a/src/delete.c b/src/delete.c index e7c9ac24..8e9b965f 100644 --- a/src/delete.c +++ b/src/delete.c @@ -256,6 +256,7 @@ delete_backup_files(pgBackup *backup) char path[MAXPGPATH]; char timestamp[100]; parray *files; + size_t num_files; /* * If the backup was deleted already, there is nothing to do. @@ -286,13 +287,14 @@ delete_backup_files(pgBackup *backup) /* delete leaf node first */ parray_qsort(files, pgFileComparePathDesc); - for (i = 0; i < parray_num(files); i++) + num_files = parray_num(files); + for (i = 0; i < num_files; i++) { pgFile *file = (pgFile *) parray_get(files, i); - /* print progress */ - elog(VERBOSE, "Delete file(%zd/%lu) \"%s\"", i + 1, - (unsigned long) parray_num(files), file->path); + if (progress) + elog(INFO, "Progress: (%zd/%zd). Process file \"%s\"", + i + 1, num_files, file->path); if (remove(file->path)) { diff --git a/src/merge.c b/src/merge.c index b01a90d0..2a24b39d 100644 --- a/src/merge.c +++ b/src/merge.c @@ -385,7 +385,7 @@ merge_files(void *arg) elog(ERROR, "Interrupted during merging backups"); if (progress) - elog(LOG, "Progress: (%d/%d). Process file \"%s\"", + elog(INFO, "Progress: (%d/%d). Process file \"%s\"", i + 1, num_files, file->path); /* diff --git a/src/restore.c b/src/restore.c index 6024f8bc..8770c358 100644 --- a/src/restore.c +++ b/src/restore.c @@ -582,7 +582,7 @@ restore_files(void *arg) rel_path = GetRelativePath(file->path,from_root); if (progress) - elog(LOG, "Progress: (%d/%lu). Process file %s ", + elog(INFO, "Progress: (%d/%lu). Process file %s ", i + 1, (unsigned long) parray_num(arguments->files), rel_path); /* diff --git a/src/validate.c b/src/validate.c index 1f758d0f..edb386ef 100644 --- a/src/validate.c +++ b/src/validate.c @@ -156,9 +156,10 @@ pgBackupValidateFiles(void *arg) { int i; validate_files_arg *arguments = (validate_files_arg *)arg; + int num_files = parray_num(arguments->files); pg_crc32 crc; - for (i = 0; i < parray_num(arguments->files); i++) + for (i = 0; i < num_files; i++) { struct stat st; pgFile *file = (pgFile *) parray_get(arguments->files, i); @@ -186,9 +187,9 @@ pgBackupValidateFiles(void *arg) if (file->is_cfs) continue; - /* print progress */ - elog(VERBOSE, "Validate files: (%d/%lu) %s", - i + 1, (unsigned long) parray_num(arguments->files), file->path); + if (progress) + elog(INFO, "Progress: (%d/%d). Process file \"%s\"", + i + 1, num_files, file->path); if (stat(file->path, &st) == -1) {