Re: Unified logging system for command-line programs - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Unified logging system for command-line programs
Date
Msg-id 7474.1554236240@sss.pgh.pa.us
Whole thread Raw
In response to Re: Unified logging system for command-line programs  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: Unified logging system for command-line programs
List 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 by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Unified logging system for command-line programs
Next
From: Alvaro Herrera
Date:
Subject: Re: Unified logging system for command-line programs