Re: vacuum verbose detail logs are unclear; log at *start* of each stage

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: vacuum verbose detail logs are unclear; log at *start* of each stage
Date: 2020-03-24 21:58:34
Message-ID: 10950.1585087114@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Justin Pryzby <pryzby(at)telsasoft(dot)com> writes:
> On Wed, Jan 22, 2020 at 02:34:57PM +0900, Michael Paquier wrote:
>> From patch 0003:
>> /*
>> + * Indent multi-line DETAIL if being sent to client (verbose)
>> + * We don't know if it's sent to the client (client_min_messages);
>> + * Also, that affects output to the logfile, too; assume that it's more
>> + * important to format messages requested by the client than to make
>> + * verbose logs pretty when also sent to the logfile.
>> + */
>> + msgprefix = elevel==INFO ? "!\t" : "";
>> Such stuff gets a -1 from me. This is not project-like, and you make
>> the translation of those messages much harder than they should be.

> I don't see why its harder to translate ?

The really fundamental problem with this is that you are trying to make
the server do what is properly the client's job, namely format messages
nicely. Please read the message style guidelines [1], particularly
the bit about "Formatting", which basically says "don't":

Formatting

Don't put any specific assumptions about formatting into the message
texts. Expect clients and the server log to wrap lines to fit their
own needs. In long messages, newline characters (\n) can be used to
indicate suggested paragraph breaks. Don't end a message with a
newline. Don't use tabs or other formatting characters. (In error
context displays, newlines are automatically added to separate levels
of context such as function calls.)

Rationale: Messages are not necessarily displayed on terminal-type
displays. In GUI displays or browsers these formatting instructions
are at best ignored.

regards, tom lane

[1] https://www.postgresql.org/docs/devel/error-style-guide.html

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2020-03-24 22:22:45 Re: Option to dump foreign data in pg_dump
Previous Message Alvaro Herrera 2020-03-24 21:49:22 Re: allow online change primary_conninfo