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

Re: LDAP Debug messages & severity levels

On Sat, 2006-01-21 at 12:13 +0100, Hallvard B Furuseth wrote:
> >
> > I don't like this approach too much; in general, I think that trying to
> > emulate variable arg number in macros leads to confusion.
> It's a helper macro, only used by the logging macros and never
> elsewhere.  I don't care if macro packages get a few extra hacks,
> since they are ugly anyway with do{}while(0), () around params etc.
> So I think a little trick like that is well worth getting rid of the
> excess unused arguments.  But it's no big deal.
> And in my opinion it's also much better than to get rid of the excess
> args by duplicating the body of these macros.

Sounds good.

> Today's slapd & tools has some design bugs with debugging vs logging:
> configure --disable-debug should only disable debugging, not logging and
> error messages.  Those are different beasts.  Also, even LDAP_DEBUG_ANY
> does not make the output unconditional.  It is not output to stderr
> unless the -d flag is given.  So we need at least three sets of macros:
> The Debug macros and Info macros which obey the debug level/loglevel,
> and the unconditional ones which do not.

Call them features :)  Now tools start with LDAP_DEBUG_NONE by default,
so they __do__ log LDAP_DEBUG_ANY messages; if you set "-d 0" you can
disable this feature.  Slapd works as usual, i.e. to enable
LDAP_DEBUG_ANY messages you need to start it with (at least) "-d none"

> Though an alternative could be to always set one bit in the ldap_debug
> and ldap_syslog variables, so that the '... & LDAP_DEBUG_ANY' will
> always be true.  Come to think of it, maybe my macros will need
> something like that anyway since they call lutil_debug().  Ehh...  I
> need to look at that.  Not sure what the effect would be of such a hack.
> BTW, I suspect I'm in a bit of trouble with the severity level argument
> as selector in the macro vs. syslog level and the slapd command line
> arguments, but I'm a bit too tired at the moment to look at that...


Ing. Pierangelo Masarati
Responsabile Open Solution
OpenLDAP Core Team

SysNet s.n.c.
Via Dossi, 8 - 27100 Pavia - ITALIA
Office:   +39.02.23998309          
Mobile:   +39.333.4963172
Email:    pierangelo.masarati@sys-net.it