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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: vacuum verbose detail logs are unclear; log at *start* of each stage
Дата
Msg-id 10950.1585087114@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: vacuum verbose detail logs are unclear; log at *start* of eachstage  (Justin Pryzby <pryzby@telsasoft.com>)
Ответы Re: vacuum verbose detail logs are unclear; log at *start* of each stage  (Daniel Gustafsson <daniel@yesql.se>)
Список pgsql-hackers
Justin Pryzby <pryzby@telsasoft.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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: allow online change primary_conninfo
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Option to dump foreign data in pg_dump