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 1kkSka-0004je-Vs for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Dec 2020 14:04:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kkSkY-0004SG-Sf for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Dec 2020 14:04:54 +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 1kkSkY-0004Q0-Lm for pgsql-hackers@lists.postgresql.org; Wed, 02 Dec 2020 14:04:54 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kkSkV-0002lf-DP for pgsql-hackers@postgresql.org; Wed, 02 Dec 2020 14:04:53 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 6C974CCF; Wed, 2 Dec 2020 09:04:48 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 02 Dec 2020 09:04:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=WwG/f4KjWwk0dB/uQ T+vOVl0rbyKKLtA58dLr0uCwDM=; b=eIlIggnAjOB8Qq/92aZsDVfBnihLHglLP ZhTU/fzpZd+NhKY2Xgmic5pbiHxphLiKB8f0NfYqm5bhC1A0IH+dYuJLAL1fsTRK GKz9BdsbjETpP1kBVSOCojSaKXyoygp5Vfa2nvsjtA7V218ZguFM7x310OmEAR96 M+phNnPqNnrNAO8u3e/lGK5qs4cKGKEvdLt1mlZWOu6RKXq3RyA3quXp8cuw84nY rtXL+SsM+6egBLv4bhWPTf5HTwS7c7Oy6j1CSvOVJ0/XCbsRWbRC9AKbgNub+W3z h6z0iqROEQnyaY+/e8giTvofztqqBYl1xApCY+6tRvd812X5dqaBQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudeigedgieduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggujggfsehttdertddtredvnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpeevgfelveegueejgefhgeetgefhgeehieefheehleetteei udeiiefhgffgheffteenucfkphepudeltddrleehrddukedrjeelnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhv hhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.18.79]) by mail.messagingengine.com (Postfix) with ESMTPA id 3EF6A1080066; Wed, 2 Dec 2020 09:04:47 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 11A3B2A09E0; Wed, 2 Dec 2020 11:04:45 -0300 (-03) Date: Wed, 2 Dec 2020 11:04:45 -0300 From: Alvaro Herrera To: Peter Eisentraut Cc: pgsql-hackers Subject: Re: convert elog(LOG) calls to ereport Message-ID: <20201202140445.GA26406@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <92d6f545-5102-65d8-3c87-489f71ea0a37@enterprisedb.com> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Dec-02, Peter Eisentraut wrote: > There are a number of elog(LOG) calls that appear to be user-facing, so they > should be ereport()s. This patch changes them. There are more elog(LOG) > calls remaining, but they all appear to be some kind of debugging support. > Also, I changed a few elog(FATAL)s that were nearby, but I didn't > specifically look for them. > - elog(LOG, "WSAIoctl(SIO_KEEPALIVE_VALS) failed: %ui", > - WSAGetLastError()); > + ereport(LOG, > + (errmsg("WSAIoctl(SIO_KEEPALIVE_VALS) failed: %ui", > + WSAGetLastError()))); Please take the opportunity to move the flag name out of the message in this one, also. I do wonder if it'd be a good idea to move the syscall name itself out of the message, too; that would reduce the number of messages to translate 50x to just "%s(%s) failed: %m" instead of one message per distinct syscall. Should fd.c messages do errcode_for_file_access() like elsewhere? Overall, it looks good to me. Thanks