Re: Unified logging system for command-line programs

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Unified logging system for command-line programs
Дата
Msg-id 7474.1554236240@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Unified logging system for command-line programs  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: Unified logging system for command-line programs  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> I don't much like the code that does
>    pg_log_error("%s", something);

> because then the string "%s" is marked for translation.

Uh, surely we've got hundreds of instances of that in the system already?

> Maybe we should
> consider a variant that takes a straight string literal instead of a
> sprintf-style fmt to avoid this problem.  We'd do something like
>    pg_log_error_v(something);
> which does not call _() within.

What it looks like that's doing is something similar to appendPQExpBuffer
versus appendPQExpBufferStr, ie, just skipping the overhead of sprintf
format processing when you don't need it.  The implications for
translatability or not are unobvious, so I'm afraid this would result
in confusion and missed translations.

I'm not necessarily against some idea like this, but how do we
separate "translatability" from "sprintf formatting"?

            regards, tom lane



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Unified logging system for command-line programs
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Unified logging system for command-line programs