Re: [HACKERS] Override compile time log levels of specific messages/modules

2016-09-11 Thread Craig Ringer
On 11 Sep. 2016 11:31, "Jim Nasby" wrote: > Actually, I wish this was a straight-up logging level feature, because I need it all the time when debugging complicated user-level code. Specifically, I wish there was a GUC that would alter (client|log)_min_messages upon entering a specific function,

Re: [HACKERS] Override compile time log levels of specific messages/modules

2016-09-10 Thread Jim Nasby
On 9/6/16 5:18 AM, Craig Ringer wrote: I think something automatic that we clearly define as unstable and not to be relied upon would be preferable. Plus we already have much of the infrastructure in elog.c as used by errcontext etc. Actually, I wish this was a straight-up logging level feature

Re: [HACKERS] Override compile time log levels of specific messages/modules

2016-09-06 Thread Craig Ringer
On 6 Sep. 2016 17:57, "Pavan Deolasee" wrote: > > > > On Tue, Sep 6, 2016 at 3:06 PM, Craig Ringer wrote: >> >> >> I think it's worth looking at how Java handles logging. We can't achieve an exact parallel in C as we don't really have a class hierarchy ... but we do have subsystems roughly groupe

Re: [HACKERS] Override compile time log levels of specific messages/modules

2016-09-06 Thread Pavan Deolasee
On Tue, Sep 6, 2016 at 3:06 PM, Craig Ringer wrote: > > I think it's worth looking at how Java handles logging. We can't achieve > an exact parallel in C as we don't really have a class hierarchy ... but we > do have subsystems roughly grouped by file and directory structure. > > Sure. In some la

Re: [HACKERS] Override compile time log levels of specific messages/modules

2016-09-06 Thread Craig Ringer
On 6 Sep. 2016 17:28, "Pavan Deolasee" wrote: > > > The patch uses some preprocessing and scripting magic to assign distinct identifiers to each module (a subdir in the source code), to each file and to each elog message. It then provides a set of functions by which an user can increase/decrease/

[HACKERS] Override compile time log levels of specific messages/modules

2016-09-06 Thread Pavan Deolasee
While reviewing Jeff's notice_lock_waits patch, I came across his comment about having a general facility for promoting selected LOG messages. So I thought I should post it here, even though the patch is probably far from being accepted in Postgres. I recently wrote a patch for Postgres-XL to do e