From: Alvaro Herrera Date: Mon, 28 Mar 2016 17:33:00 +0000 (-0300) Subject: pg_rewind: Improve internationalization X-Git-Tag: REL9_6_BETA1~370 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cad3edef4f51c37c4b4d8667a2e76a81ca53f9e7;p=postgresql 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 --- diff --git a/src/bin/pg_rewind/datapagemap.c b/src/bin/pg_rewind/datapagemap.c index 011693faa4..a79b427527 100644 --- a/src/bin/pg_rewind/datapagemap.c +++ b/src/bin/pg_rewind/datapagemap.c @@ -13,6 +13,7 @@ #include "postgres_fe.h" #include "datapagemap.h" +#include "logging.h" struct datapagemap_iterator { @@ -120,7 +121,7 @@ datapagemap_print(datapagemap_t *map) iter = datapagemap_iterate(map); while (datapagemap_next(iter, &blocknum)) - printf(" blk %u\n", blocknum); + pg_log(PG_DEBUG, " block %u\n", blocknum); pg_free(iter); } diff --git a/src/bin/pg_rewind/filemap.c b/src/bin/pg_rewind/filemap.c index 895deb1e13..a3e52f6f2a 100644 --- a/src/bin/pg_rewind/filemap.c +++ b/src/bin/pg_rewind/filemap.c @@ -531,7 +531,11 @@ print_filemap(void) if (entry->action != FILE_ACTION_NONE || entry->pagemap.bitmapsize > 0) { - printf("%s (%s)\n", entry->path, action_to_str(entry->action)); + pg_log(PG_DEBUG, + /*------ + translator: first %s is a file path, second is a keyword such as COPY */ + "%s (%s)\n", entry->path, + action_to_str(entry->action)); if (entry->pagemap.bitmapsize > 0) datapagemap_print(&entry->pagemap); diff --git a/src/bin/pg_rewind/pg_rewind.c b/src/bin/pg_rewind/pg_rewind.c index 4c80000cea..4004bbfc77 100644 --- a/src/bin/pg_rewind/pg_rewind.c +++ b/src/bin/pg_rewind/pg_rewind.c @@ -470,9 +470,9 @@ getTimelineHistory(ControlFileData *controlFile, int *nentries) int i; if (controlFile == &ControlFile_source) - printf("Source timeline history:\n"); + pg_log(PG_DEBUG, "Source timeline history:\n"); else if (controlFile == &ControlFile_target) - printf("Target timeline history:\n"); + pg_log(PG_DEBUG, "Target timeline history:\n"); else Assert(false); @@ -484,9 +484,11 @@ getTimelineHistory(ControlFileData *controlFile, int *nentries) TimeLineHistoryEntry *entry; entry = &history[i]; - printf("%d: %X/%X - %X/%X\n", entry->tli, - (uint32) (entry->begin >> 32), (uint32) (entry->begin), - (uint32) (entry->end >> 32), (uint32) (entry->end)); + pg_log(PG_DEBUG, + /* translator: %d is a timeline number, others are LSN positions */ + "%d: %X/%X - %X/%X\n", entry->tli, + (uint32) (entry->begin >> 32), (uint32) (entry->begin), + (uint32) (entry->end >> 32), (uint32) (entry->end)); } }