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 1gdh1h-0006KN-6X for pgsql-hackers@arkaria.postgresql.org; Sun, 30 Dec 2018 19:45:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gdh1f-0003D0-2Y for pgsql-hackers@arkaria.postgresql.org; Sun, 30 Dec 2018 19:45:31 +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 1gdh1e-0003Bl-QF for pgsql-hackers@lists.postgresql.org; Sun, 30 Dec 2018 19:45:30 +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 1gdh1c-0005dY-C6 for pgsql-hackers@postgresql.org; Sun, 30 Dec 2018 19:45:30 +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 wBUJjNt5021142; Sun, 30 Dec 2018 14:45:23 -0500 From: Tom Lane To: Peter Eisentraut cc: pgsql-hackers Subject: Re: Unified logging system for command-line programs In-reply-to: <6a609b43-4f57-7348-6480-bd022f924310@2ndquadrant.com> References: <6a609b43-4f57-7348-6480-bd022f924310@2ndquadrant.com> Comments: In-reply-to Peter Eisentraut message dated "Sun, 30 Dec 2018 17:07:37 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21140.1546199123.1@sss.pgh.pa.us> Date: Sun, 30 Dec 2018 14:45:23 -0500 Message-ID: <21141.1546199123@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Peter Eisentraut writes: > I have developed a patch that unifies the various ad hoc logging > (message printing, error printing) systems used throughout the > command-line programs. I've not read the patch in any detail, but +1 for making this more uniform. > - Common files (common/, fe_utils/, etc.) can handle logging much more > simply by just using one API without worrying too much about the context > of the calling program, requiring callbacks, or having to pass > "progname" around everywhere. It seems like a shame that src/common files still need to have #ifdef FRONTEND variant code to deal with frontend vs. backend conventions. I wonder how hard it would be to layer some subset of ereport() functionality on top of what you have here, so as to get rid of those #ifdef stanzas. regards, tom lane