Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lI3Qf-0000Zd-7r for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Mar 2021 05:55:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lI3Qd-0007S8-Ls for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Mar 2021 05:55:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lI3Qd-0007S1-FZ for pgsql-hackers@lists.postgresql.org; Fri, 05 Mar 2021 05:55:11 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lI3Qb-0005BZ-6k for pgsql-hackers@lists.postgresql.org; Fri, 05 Mar 2021 05:55:11 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 1255t2VZ1443697; Fri, 5 Mar 2021 00:55:02 -0500 From: Tom Lane To: "tsunakawa.takay@fujitsu.com" cc: "alvherre@alvh.no-ip.org" , "iwata.aya@fujitsu.com" , "k.jamison@fujitsu.com" , "'Kyotaro Horiguchi'" , "pgsql-hackers@lists.postgresql.org" Subject: Re: libpq debug log In-reply-to: References: <1d650278-552a-4bd2-8411-a907fd54446c@www.fastmail.com> <20210226.161239.974671556832294688.horikyota.ntt@gmail.com> <20210226.173032.106337339140685280.horikyota.ntt@gmail.com> <1425287.1614899023@sss.pgh.pa.us> Comments: In-reply-to "tsunakawa.takay@fujitsu.com" message dated "Fri, 05 Mar 2021 05:33:31 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1443695.1614923702.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 05 Mar 2021 00:55:02 -0500 Message-ID: <1443696.1614923702@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "tsunakawa.takay@fujitsu.com" writes: > Oops, the logging facility needs the destination (conn->pfdebug). So, i= t will be: > void pqLogMessage(PGconn *conn, bool toServer); Right, and it'd need the debug flags too, so +1 for just passing the PGconn instead of handing those over piecemeal. But I think passing the message start address explicitly might be better than having it understand the buffering behavior in enough detail to know where to find the message. Part of the point here (IMO) is to decouple the tracing logic from the core libpq logic, in hopes of not having common-mode bugs. regards, tom lane