Hallvard B Furuseth wrote:
[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.
Well, we still need to be able to tie in globally so that the command line debug/syslog selectors work. Of course, we seem to have solved that issue already, so perhaps this can be done a lot more smoothly/easily now.
The current LogX() macros only use priority levels when calling syslog(). I have a feeling that the debug output on stderr ought to have priority controls too, but that may be one of the details that snarled us up last time.
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.