On 6 Sep. 2016 17:28, "Pavan Deolasee" <pavan.deola...@gmail.com> 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/set log levels for either individual messages or all
messages within a source file or source module. The log levels can be
changed only for specific backends or all current or future backends. If
you configure with --enable-genmsgids switch, a MSGMODULES and MSGIDS file
is created in $srcdir, which can later be used to know ids assigned to
various modules/messages.

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.

Being able to promote/demote these or selective lower the log level
threshold on a directory, file, function and line level would be
exceedingly handy. Pretty much all of that can be magic'd up from macro
output so hopefully no postprocessing should be needed. (Though only gcc
has _FUNC_ or _FUNCTION_ I think so we'd have selective support there.)

Reply via email to