log_min_messages shows debug instead of debug2

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

log_min_messages shows debug instead of debug2

Ideriha, Takeshi

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

 


debug2_log_level.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: log_min_messages shows debug instead of debug2

Robert Haas
On Tue, May 15, 2018 at 4:46 AM, Ideriha, Takeshi
<[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: log_min_messages shows debug instead of debug2

Tom Lane-2
Robert Haas <[hidden email]> writes:
> On Tue, May 15, 2018 at 4:46 AM, Ideriha, Takeshi
> <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: log_min_messages shows debug instead of debug2

Robert Haas
On Wed, May 16, 2018 at 11:28 AM, Tom Lane <[hidden email]> wrote:

> Robert Haas <[hidden email]> writes:
>> On Tue, May 15, 2018 at 4:46 AM, Ideriha, Takeshi
>> <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: log_min_messages shows debug instead of debug2

Kyotaro HORIGUCHI-2
At Wed, 16 May 2018 12:37:48 -0400, Robert Haas <[hidden email]> wrote in <[hidden email]>

> On Wed, May 16, 2018 at 11:28 AM, Tom Lane <[hidden email]> wrote:
> > Robert Haas <[hidden email]> writes:
> >> On Tue, May 15, 2018 at 4:46 AM, Ideriha, Takeshi
> >> <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: log_min_messages shows debug instead of debug2

Robert Haas
On Thu, May 17, 2018 at 4:58 AM, Kyotaro HORIGUCHI
<[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

RE: log_min_messages shows debug instead of debug2

Ideriha, Takeshi
>-----Original Message-----
>From: Robert Haas [mailto:[hidden email]]
>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
Previous Thread Next Thread