Re: Unified logging system for command-line programs
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>,
Donald Dong <xdong@csumb.edu>, Andres Freund <andres@anarazel.de>
Date: 2019-04-02T20:17:20Z
Lists: 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
Commits
-
Unified logging system for command-line programs
- cc8d41511721 12.0 landed
-
Assorted translatable string fixes
- 55a70a023c3d 10.0 cited