Re: Quoting filename in using facing log messages

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Quoting filename in using facing log messages
Date: 2023-09-14 07:56:03
Message-ID: ZQK8k11sFEz64c8T@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 13, 2023 at 02:02:47PM +0200, Daniel Gustafsson wrote:
> It might be worth concatenating the errmsg() while there since we typically
> don't linebreak errmsg strings anymore for greppability:
>
> - errmsg("could not write to log file %s "
> - "at offset %u, length %zu: %m",
> + errmsg("could not write to log file \"%s\" at offset %u, length %zu: %m",
>
> I don't have strong feelings wrt that, just have a vague memory of "concatenate
> when touching" as an informal guideline.

Because these are slightly easier to grep when looking for a given
pattern in the tree.

(I'm OK with your patch as well, FWIW.)
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2023-09-14 08:14:01 Re: Cleaning up array_in()
Previous Message Michael Paquier 2023-09-14 07:29:22 Re: Have better wording for snapshot file reading failure