[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: logging



[Moving from -software to -devel]

Howard Chu writes:
> There was an effort to introduce various log levels back in the
> OpenLDAP 2.1 timeframe but it turned out to be too cumbersome and we
> eventually gave up on it. If someone else wants to take a stab at it,
> they're welcome to give it a go.

If I remember that effort correctly, one mistake may have been to stuff
everything into a global log system (which needed to know about the
various modules), instead of having the modules keep track of their
desired log levels and severity levels.

Each module could optionally maintain its own struct with {module name,
mapping of loglevel/'-d' level => severity level} or whatever, similar
to what we have a global structure for now.  A pointer to it would be
passed as a new argument to the log macros.  For that matter,
slapd.conf's "loglevel" could then be database-specific.

Source files which mostly log about a single module could #define some
standardized macro to refer to that module's log struct too.  Then a set
of log macros (with the same names as the current ones of course) can
use that macro as the argument for the module pointer.

-- 
Regards,
Hallvard