Re: Lost logs with csvlog redirected to stderr under WIN32 service

Поиск
Список
Период
Сортировка
От Chris Bandy
Тема Re: Lost logs with csvlog redirected to stderr under WIN32 service
Дата
Msg-id 30a3cd02-5fc3-4956-1dbb-05bee26be158@gmail.com
обсуждение исходный текст
Ответ на Lost logs with csvlog redirected to stderr under WIN32 service  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: Lost logs with csvlog redirected to stderr under WIN32 service  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On 10/6/21 12:10 AM, Michael Paquier wrote:
> I have thought about various ways to
> fix that, and finished with a solution where we handle csvlog first,
> and fallback to stderr after so as there is only one code path for
> stderr, as of the attached.  This reduces a bit the confusion around
> the handling of the stderr data that gets free()'d in more code paths
> than really needed.

I don't have a windows machine to test, but this refactor looks good to me.

> +    /* Write to CSV log, if enabled */
> +    if ((Log_destination & LOG_DESTINATION_CSVLOG) != 0)

This was originally "if (Log_destination & LOG_DESTINATION_CSVLOG)" and
other conditions nearby still lack the "!= 0". Whatever the preferred
style, the lines touched by this patch should probably do this consistently.

-- Chris



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

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: strange case of "if ((a & b))"
Следующее
От: "kuroda.hayato@fujitsu.com"
Дата:
Сообщение: RE: Allow escape in application_name