Re: Override compile time log levels of specific messages/modules - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: Override compile time log levels of specific messages/modules
Date
Msg-id CAMsr+YE9xtBQkLhsvBjz4oj0Zv5TZT2LkER6+-EjnQJec31Rjw@mail.gmail.com
Whole thread Raw
In response to Override compile time log levels of specific messages/modules  (Pavan Deolasee <pavan.deolasee@gmail.com>)
Responses Re: Override compile time log levels of specific messages/modules  (Pavan Deolasee <pavan.deolasee@gmail.com>)
List pgsql-hackers
<p dir="ltr"><p dir="ltr">On 6 Sep. 2016 17:28, "Pavan Deolasee" <<a
href="mailto:pavan.deolasee@gmail.com">pavan.deolasee@gmail.com</a>>wrote:<br /> ><p dir="ltr">><br /> >
Thepatch uses some preprocessing and scripting magic to assign distinct identifiers to each module (a subdir in the
sourcecode), to each file and to each elog message. It then provides a set of functions by which an user can
increase/decrease/setlog levels for either individual messages or all messages within a source file or source module.
Thelog levels can be changed only for specific backends or all current or future backends. If you configure with
--enable-genmsgidsswitch, a MSGMODULES and MSGIDS file is created in $srcdir, which can later be used to know ids
assignedto various modules/messages.<p dir="ltr">I think it's worth looking at how Java handles logging. We can't
achievean exact parallel in C as we don't really have a class hierarchy ... but we do have subsystems roughly grouped
byfile and directory structure.<p dir="ltr">Being able to promote/demote these or selective lower the log level
thresholdon a directory, file, function and line level would be exceedingly handy. Pretty much all of that can be
magic'dup from macro output so hopefully no postprocessing should be needed. (Though only gcc has _FUNC_ or _FUNCTION_
Ithink so we'd have selective support there.)<br /> 

pgsql-hackers by date:

Previous
From: Pavan Deolasee
Date:
Subject: Override compile time log levels of specific messages/modules
Next
From: Petr Jelinek
Date:
Subject: Re: Logical Replication WIP