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

Re: LDAP Debug messages & severity levels



On Thu, 2005-12-22 at 09:33 -0800, Kurt D. Zeilenga wrote:
> At 04:37 AM 12/22/2005, Pierangelo Masarati wrote:
> >In my design, the
> >infrastructure to support it will be very light; moreover, there will be
> >no need to change __all__ statements: on the contrary, existing Debug()
> >statements would just have a neutral, default behavior; this means no
> >#ifdefs, no NEW_LOGGING style intrusivity and so. 
> 
> I note that I think it would be fine for a new logging system
> to require all existing Debug statements to be rewritten
> as long as:
>         a) the rewrite work can be automated
>         b) new statements would work with both old logging
>         and new logging
>         c) switching between new and old logging would
>         be a simple matter (such as defining some macro).
> 
> That is, I have no problem doing something like:
>         %s/Debug\(/Log\( defaultSeverity,/g

My idea is to

#ifdef OLD_LOGGING
#define Debug(/* as before */)
#else
#define Debug(l,f,a1,a2,a3) Log(l,defaultSeverity,f,a1,a2,a3)
#endif

so no commits will ever be required for those messages we don't urge to
provide a specific severity.

> 
> where Log was defined to expand to a Debug statement if
> using old logging and used directly in new logging.
> 
> I certainly do not want to see #ifdef NEW_LOGGING spewed
> throughout the code again.

that's precisely my intention :)  since I need this quite soon, the
least code gets touched, and the least intrusive the change is, the
better.

> 
> > I haven't yet considered the implications of --disable-debug, though.
> 
> Long term, I rather this either completely go away or
> logging statements below some severity level be put
> behind #ifdef LDAP_DEBUG or the like.

I think any decision we take with respect to that will fit in my scheme
as soon as we start moving to the new scheme calls with higher severity;
in that case it would be trivial to define the new calls to be always
on, while turning the calls to Debug() to nothing.

p.




Ing. Pierangelo Masarati
Responsabile Open Solution
OpenLDAP Core Team

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