]> granicus.if.org Git - postgresql/commitdiff
pg_rewind: Improve internationalization
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 28 Mar 2016 17:33:00 +0000 (14:33 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 28 Mar 2016 17:33:00 +0000 (14:33 -0300)
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

src/bin/pg_rewind/datapagemap.c
src/bin/pg_rewind/filemap.c
src/bin/pg_rewind/pg_rewind.c

index 011693faa4445b0a6cffca2bc6f0c593e7cf2ffb..a79b4275274f38e979bcfac956597164d870c650 100644 (file)
@@ -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);
 }
index 895deb1e13a03d6f5a263715e0ea85079445f658..a3e52f6f2a71aeb6f4ab4fbd9ad11d5be55a86bd 100644 (file)
@@ -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);
index 4c80000ceaea59b60180775eed7bbe8e37384642..4004bbfc774c3fef79056f90e4d15721ad006a4d 100644 (file)
@@ -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));
                }
        }