Re: Unified logging system for command-line programs

Artur Zakirov <a.zakirov@postgrespro.ru>

From: Arthur Zakirov <a.zakirov@postgrespro.ru>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Donald Dong <xdong@csumb.edu>, Andres Freund <andres@anarazel.de>, Tom Lane <tgl@sss.pgh.pa.us>
Date: 2019-03-13T11:36:00Z
Lists: pgsql-hackers
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


Commits

  1. Unified logging system for command-line programs

  2. Assorted translatable string fixes