Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit cad3ede

Browse files
committed
pg_rewind: Improve internationalization
This is mostly cosmetic since two of the three changes are debug messages, and the third one is just a progress indicator. Author: Michaël Paquier
1 parent 37732a2 commit cad3ede

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

src/bin/pg_rewind/datapagemap.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "postgres_fe.h"
1414

1515
#include "datapagemap.h"
16+
#include "logging.h"
1617

1718
struct datapagemap_iterator
1819
{
@@ -120,7 +121,7 @@ datapagemap_print(datapagemap_t *map)
120121

121122
iter = datapagemap_iterate(map);
122123
while (datapagemap_next(iter, &blocknum))
123-
printf(" blk %u\n", blocknum);
124+
pg_log(PG_DEBUG, " block %u\n", blocknum);
124125

125126
pg_free(iter);
126127
}

src/bin/pg_rewind/filemap.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,11 @@ print_filemap(void)
531531
if (entry->action != FILE_ACTION_NONE ||
532532
entry->pagemap.bitmapsize > 0)
533533
{
534-
printf("%s (%s)\n", entry->path, action_to_str(entry->action));
534+
pg_log(PG_DEBUG,
535+
/*------
536+
translator: first %s is a file path, second is a keyword such as COPY */
537+
"%s (%s)\n", entry->path,
538+
action_to_str(entry->action));
535539

536540
if (entry->pagemap.bitmapsize > 0)
537541
datapagemap_print(&entry->pagemap);

src/bin/pg_rewind/pg_rewind.c

+7-5
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,9 @@ getTimelineHistory(ControlFileData *controlFile, int *nentries)
470470
int i;
471471

472472
if (controlFile == &ControlFile_source)
473-
printf("Source timeline history:\n");
473+
pg_log(PG_DEBUG, "Source timeline history:\n");
474474
else if (controlFile == &ControlFile_target)
475-
printf("Target timeline history:\n");
475+
pg_log(PG_DEBUG, "Target timeline history:\n");
476476
else
477477
Assert(false);
478478

@@ -484,9 +484,11 @@ getTimelineHistory(ControlFileData *controlFile, int *nentries)
484484
TimeLineHistoryEntry *entry;
485485

486486
entry = &history[i];
487-
printf("%d: %X/%X - %X/%X\n", entry->tli,
488-
(uint32) (entry->begin >> 32), (uint32) (entry->begin),
489-
(uint32) (entry->end >> 32), (uint32) (entry->end));
487+
pg_log(PG_DEBUG,
488+
/* translator: %d is a timeline number, others are LSN positions */
489+
"%d: %X/%X - %X/%X\n", entry->tli,
490+
(uint32) (entry->begin >> 32), (uint32) (entry->begin),
491+
(uint32) (entry->end >> 32), (uint32) (entry->end));
490492
}
491493
}
492494

0 commit comments

Comments
 (0)