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

RE: NEW_LOGGING



Perhaps so. One other option is to just define a large number of log macros,
covering a range of args:

#define LDAP_LOG(a,b,c)
#define LDAP_LOG(a,b,c,d)
#define LDAP_LOG(a,b,c,d,e)
#define LDAP_LOG(a,b,c,d,e,f)

and so on...

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support

-----Original Message-----
From: Julius Enarusai [mailto:jenarusa@us.ibm.com]
Sent: Friday, May 10, 2002 11:31 AM
To: Howard Chu
Cc: Hallvard B Furuseth; openldap-devel@OpenLDAP.org
Subject: RE: NEW_LOGGING




>It appears that at least the LEVEL argument needs to be available to the
>lutil_log function, so that it can pass it on via syslog(). One way to
>do this would be to provide the level redundantly, once in the macro
>arguments
>and once in the log arguments. (blech)
>
>As another alternative, hard-code the level in individual log functions:
>
>#define        LDAP_LOG_WARNING(subsys, args) do { \
> if (ldap_loglevels[LDAP_SUBSYS_##subsys] >= LDAP_LEVEL_WARNING) \
> lutil_log_warning args; \
> } while(0)

In addition to the LEVEL, it may be usefull to also pass the SUBSYS ID to
ldap_log and actually include that in the log message. Currently, if a user
specifies multiple SUBSYSTEMs and LEVELs, everything gets logged in the same
log file. Therefore it makes it somewhat cumbersome to look for (or grep
for) messages from a specific SUBSYSTEM in the log file.

Julius