Thread: log_min_messages shows debug instead of debug2

log_min_messages shows debug instead of debug2

From
"Ideriha, Takeshi"
Date:

Hi,

 

I noticed that if log_min_messages is set to ‘debug2’, it shows ‘debug’ instead of debug2.

Showing other debug options like debug1 work normally.

This is same for client_min_messages.

 

According to a033daf56 and baaad2330, debug is an alias for debug2 and for backward-compatibility.

And also these debug options are mainly used for PostgreSQL hackers, so I think this is a trivial issue.

 

Patch attached.

The output of ‘show log_min_messages’ becomes ‘debug2’ if it’s set to either debug or debug2.

It passed make installcheck.

 

I just changed the order of server_message_level_options[]

because in this case SHOW command linearly searches GUC option by config_enum_lookup_by_value().

 

What do you think about it?

If it’s worth committing, do I need test? I couldn’t find the relevant test set.

 

====================

Takeshi Ideriha

Fujitsu Limited

 

Attachment

Re: log_min_messages shows debug instead of debug2

From
Robert Haas
Date:
On Tue, May 15, 2018 at 4:46 AM, Ideriha, Takeshi
<ideriha.takeshi@jp.fujitsu.com> wrote:
> I noticed that if log_min_messages is set to ‘debug2’, it shows ‘debug’
> instead of debug2.
>
> Patch attached.

Seems worth changing to me.  Anyone else think differently?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: log_min_messages shows debug instead of debug2

From
Tom Lane
Date:
Robert Haas <robertmhaas@gmail.com> writes:
> On Tue, May 15, 2018 at 4:46 AM, Ideriha, Takeshi
> <ideriha.takeshi@jp.fujitsu.com> wrote:
>> I noticed that if log_min_messages is set to ‘debug2’, it shows ‘debug’
>> instead of debug2.

> Seems worth changing to me.  Anyone else think differently?

I think the current behavior was intentional at some point, probably
with the idea that if you put in "debug" it should come out as "debug".
This patch just moves the discrepancy.  Still, it's more precise to
print debug2, so I'm okay with changing.

            regards, tom lane


Re: log_min_messages shows debug instead of debug2

From
Robert Haas
Date:
On Wed, May 16, 2018 at 11:28 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> On Tue, May 15, 2018 at 4:46 AM, Ideriha, Takeshi
>> <ideriha.takeshi@jp.fujitsu.com> wrote:
>>> I noticed that if log_min_messages is set to ‘debug2’, it shows ‘debug’
>>> instead of debug2.
>
>> Seems worth changing to me.  Anyone else think differently?
>
> I think the current behavior was intentional at some point, probably
> with the idea that if you put in "debug" it should come out as "debug".

Hmm, that's an angle I hadn't considered.

> This patch just moves the discrepancy.  Still, it's more precise to
> print debug2, so I'm okay with changing.

OK.  Let's see if anyone else has an opinion.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: log_min_messages shows debug instead of debug2

From
Kyotaro HORIGUCHI
Date:
At Wed, 16 May 2018 12:37:48 -0400, Robert Haas <robertmhaas@gmail.com> wrote in
<CA+TgmobTWhCE_k8mKW+S3P4Rizz-4AZcax_9XjDjf0G0fn24Ng@mail.gmail.com>
> On Wed, May 16, 2018 at 11:28 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > Robert Haas <robertmhaas@gmail.com> writes:
> >> On Tue, May 15, 2018 at 4:46 AM, Ideriha, Takeshi
> >> <ideriha.takeshi@jp.fujitsu.com> wrote:
> >>> I noticed that if log_min_messages is set to ‘debug2’, it shows ‘debug’
> >>> instead of debug2.
> >
> >> Seems worth changing to me.  Anyone else think differently?
> >
> > I think the current behavior was intentional at some point, probably
> > with the idea that if you put in "debug" it should come out as "debug".
> 
> Hmm, that's an angle I hadn't considered.
> 
> > This patch just moves the discrepancy.  Still, it's more precise to
> > print debug2, so I'm okay with changing.
> 
> OK.  Let's see if anyone else has an opinion.

It's not about me, but without knowing the history, "debug" can
look as if it is less chatty than "debug2" or even "debug1". All
log level of "debugN" are seen as DEBUG in log lines. Thus
showing "debug2" as just "debug" may obfuscate the cause of
having so many log lines.

From another view point, it can be thought as not-good that print
a value with a hidden word.

In short, I submit +1 for this.

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center

Re: log_min_messages shows debug instead of debug2

From
Robert Haas
Date:
On Thu, May 17, 2018 at 4:58 AM, Kyotaro HORIGUCHI
<horiguchi.kyotaro@lab.ntt.co.jp> wrote:
> It's not about me, but without knowing the history, "debug" can
> look as if it is less chatty than "debug2" or even "debug1". All
> log level of "debugN" are seen as DEBUG in log lines. Thus
> showing "debug2" as just "debug" may obfuscate the cause of
> having so many log lines.
>
> From another view point, it can be thought as not-good that print
> a value with a hidden word.
>
> In short, I submit +1 for this.

OK, I'm happy enough to commit it then, barring other objections.  I
was just going to just do that but then I realized we're in feature
freeze right now, so I suppose this should go into the next
CommitFest.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


RE: log_min_messages shows debug instead of debug2

From
"Ideriha, Takeshi"
Date:
>-----Original Message-----
>From: Robert Haas [mailto:robertmhaas@gmail.com]
>OK, I'm happy enough to commit it then, barring other objections.  I was just going to
>just do that but then I realized we're in feature freeze right now, so I suppose this
>should go into the next CommitFest.

Thank you for your discussion.
Sure, I registed it to the next CommitFest with 'Ready for Committer'.

https://commitfest.postgresql.org/18/1638/ 

Regards,
Takeshi Ideriha

Re: log_min_messages shows debug instead of debug2

From
Andrew Dunstan
Date:

On 05/17/2018 08:43 PM, Ideriha, Takeshi wrote:
>> -----Original Message-----
>> From: Robert Haas [mailto:robertmhaas@gmail.com]
>> OK, I'm happy enough to commit it then, barring other objections.  I was just going to
>> just do that but then I realized we're in feature freeze right now, so I suppose this
>> should go into the next CommitFest.
> Thank you for your discussion.
> Sure, I registed it to the next CommitFest with 'Ready for Committer'.
>
> https://commitfest.postgresql.org/18/1638/
>

Committed.

cheers

andrew

-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services