pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Donald Dong <xdong@csumb.edu>
Cc: Andres Freund <andres@anarazel.de>
Subject: Re: Unified logging system for command-line programs
Date: Tue, 02 Apr 2019 16:17:20 -0400
Message-ID: <7474.1554236240@sss.pgh.pa.us> (raw)
In-Reply-To: <20190402195634.GA14682@alvherre.pgsql>
References: <20190402195634.GA14682@alvherre.pgsql>

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





view thread (27+ messages)  latest in thread

Message-ID: <7474.1554236240@sss.pgh.pa.us>
Permalink:  ../7474.1554236240@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7474.1554236240@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, peter.eisentraut@2ndquadrant.com, xdong@csumb.edu, andres@anarazel.de
  Subject: Re: Unified logging system for command-line programs
  In-Reply-To: <7474.1554236240@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox