1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-01-25 11:53:32 +02:00

Show progress messages with INFO verbose level

This commit is contained in:
Arthur Zakirov 2018-12-06 16:03:29 +03:00 committed by Anastasia
parent 7aa81561b2
commit 901062188d
4 changed files with 13 additions and 10 deletions

View File

@ -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))
{

View File

@ -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);
/*

View File

@ -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);
/*

View File

@ -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)
{