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 1h42C7-0001Lt-27 for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Mar 2019 11:37:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h42B6-0004NL-J6 for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Mar 2019 11:36:08 +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 1h42B6-0004Id-8F for pgsql-hackers@lists.postgresql.org; Wed, 13 Mar 2019 11:36:08 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h42B3-0005Qc-8e for pgsql-hackers@postgresql.org; Wed, 13 Mar 2019 11:36:07 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 9CFD921C3CC4; Wed, 13 Mar 2019 14:36:04 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from [192.168.27.237] (gw.postgrespro.ru [93.174.131.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 6A05421C2821; Wed, 13 Mar 2019 14:36:04 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1552476964; bh=BXZqxNK8tBGDWES9H+fFHYWFfgLMzzH6LBg+7patcWk=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=SurACRgDLluXJXgeQc38IVtj7vS6+ZBpVBpK1Gdi0Jp4o+UyxVmUPkXxJZm8FzSH6 w/KgFUhLEWvFugMau2eDR7jStUFShobqxBpXn0kWHum+ZFpfBHBjCDJLMajm1rtMQ+ 1NWYojRTuhU27CeUQdGpU4wLQO6Cd75glOaOcQH0= Subject: Re: Unified logging system for command-line programs To: Peter Eisentraut , pgsql-hackers Cc: Donald Dong , Andres Freund , Tom Lane References: <6a609b43-4f57-7348-6480-bd022f924310@2ndquadrant.com> <21141.1546199123@sss.pgh.pa.us> <20181231155557.7mokxwg7fnvoxd4a@alap3.anarazel.de> <841dd9fb-3550-dce0-e9ff-8f64cac9f15d@2ndquadrant.com> <20190103180315.o4gh3id5quh5aebc@alap3.anarazel.de> <6174.1546549274@sss.pgh.pa.us> <4159.1546553023@sss.pgh.pa.us> <20190103220801.pi234uthwjguwrt3@alap3.anarazel.de> <38A737AF-9C4E-483F-B8DD-7B5E718B66C8@csumb.edu> <5BE33A5D-8B32-43E0-97C6-C30FC7AF9207@csumb.edu> From: Arthur Zakirov Message-ID: <4a27d368-ea8d-f33e-5f2c-5469c4b5eeff@postgrespro.ru> Date: Wed, 13 Mar 2019 14:36:00 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, On 22.02.2019 11:39, Peter Eisentraut wrote: > Here is an updated patch. I've finished the functionality to the point > where I'm content with it. I fixed up some of the remaining special > cases in pg_dump that I hadn't sorted out last time. I also moved the > scattered setvbuf(stderr, ...) handling (for Windows) into a central > place. Colors can now be configured, too. I played with the patch and with coloring of an output. It works neat. On thing I noticed that some messages may have double log level. For example: $ psql test psql: fatal: FATAL: database "test" does not exist It is becase psql appends its own level and appends the message from a server (including servers log level). I don't think that it is nasty, but it may confuse someone. Notice that without the patch the output is: $ psql test psql: FATAL: database "test" does not exist -- Arthur Zakirov Postgres Professional: http://www.postgrespro.com Russian Postgres Company