Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBPqk-0006Z6-Pa for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Apr 2019 20:17:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hBPqi-0007Aj-B8 for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Apr 2019 20:17:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBPqi-0007Ac-2o for pgsql-hackers@lists.postgresql.org; Tue, 02 Apr 2019 20:17:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBPqa-0007DC-7b for pgsql-hackers@postgresql.org; Tue, 02 Apr 2019 20:17:35 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x32KHK5A007475; Tue, 2 Apr 2019 16:17:20 -0400 From: Tom Lane To: Alvaro Herrera cc: Peter Eisentraut , pgsql-hackers , Donald Dong , Andres Freund Subject: Re: Unified logging system for command-line programs In-reply-to: <20190402195634.GA14682@alvherre.pgsql> References: <20190402195634.GA14682@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Tue, 02 Apr 2019 16:56:34 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7473.1554236240.1@sss.pgh.pa.us> Date: Tue, 02 Apr 2019 16:17:20 -0400 Message-ID: <7474.1554236240@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera 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