Re: pgsql: Mark the second argument of pg_log as the translatable string in

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: pgsql: Mark the second argument of pg_log as the translatable string in
Дата
Msg-id 20150413171705.GQ4369@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: pgsql: Mark the second argument of pg_log as the translatable string in  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: pgsql: Mark the second argument of pg_log as the translatable string in  (Fujii Masao <masao.fujii@gmail.com>)
Список pgsql-committers
Michael Paquier wrote:
> On Sun, Apr 12, 2015 at 10:17 AM, Alvaro Herrera wrote:
> > What pg_basebackup's progress_report() does is have the message in the
> > translatable part not include the \r; the \r is in a separate fprintf()
> > call.
>
> Like the attached then.

Not a fan of this approach, because now this function knows that
pg_log(PG_PROGRESS) is equivalent to printf().  This abstraction is a
bit leaky, isn't it ...  Probably not worth sweating about, though.

> diff --git a/src/bin/pg_rewind/logging.c b/src/bin/pg_rewind/logging.c
> index aba12d8..3e2dc76 100644
> --- a/src/bin/pg_rewind/logging.c
> +++ b/src/bin/pg_rewind/logging.c
> @@ -134,7 +134,8 @@ progress_report(bool force)
>      snprintf(fetch_size_str, sizeof(fetch_size_str), INT64_FORMAT,
>               fetch_size / 1024);
>
> -    pg_log(PG_PROGRESS, "%*s/%s kB (%d%%) copied\r",
> +    pg_log(PG_PROGRESS, "%*s/%s kB (%d%%) copied",
>             (int) strlen(fetch_size_str), fetch_done_str, fetch_size_str,
>             percent);
> +    printf("\r");
>  }



--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


В списке pgsql-committers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: Move pgbench from contrib/ to src/bin/
Следующее
От: Alvaro Herrera
Дата:
Сообщение: pgsql: Remove duplicated word in README