From: Pierangelo Masarati Date: Wed, 28 Dec 2005 01:22:56 +0000 (+0000) Subject: Log0 X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~499 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6f68a1af6d2abd50969a9810906214183adc4740;p=openldap Log0 --- diff --git a/include/ldap_log.h b/include/ldap_log.h index 84f886e324..f81d57752d 100644 --- a/include/ldap_log.h +++ b/include/ldap_log.h @@ -148,6 +148,13 @@ extern void eb_syslog(int pri, const char *fmt, ...); /* this doesn't below as part of ldap.h */ #ifdef LDAP_SYSLOG +#define Log0( level, severity, fmt ) \ + do { \ + if ( ldap_debug & (level) ) \ + lutil_debug( ldap_debug, (level), (fmt) ); \ + if ( ldap_syslog & (level) ) \ + syslog( LDAP_LEVEL_MASK((severity)), (fmt) ); \ + } while ( 0 ) #define Log1( level, severity, fmt, arg1 ) \ do { \ if ( ldap_debug & (level) ) \ @@ -188,6 +195,11 @@ extern void eb_syslog(int pri, const char *fmt, ...); #define LogTest(level) ( ( ldap_debug | ldap_syslog ) & (level) ) #else /* ! LDAP_SYSLOG */ +#define Log0( level, severity, fmt ) \ + do { \ + if ( ldap_debug & (level) ) \ + lutil_debug( ldap_debug, (level), (fmt) ); \ + } while ( 0 ) #define Log1( level, severity, fmt, arg1 ) \ do { \ if ( ldap_debug & (level) ) \ @@ -220,6 +232,7 @@ extern void eb_syslog(int pri, const char *fmt, ...); #else /* ! LDAP_DEBUG */ /* TODO: in case LDAP_DEBUG is undefined, make sure logs with appropriate * severity gets thru anyway */ +#define Log0( level, severity, fmt ) #define Log1( level, severity, fmt, arg1 ) #define Log2( level, severity, fmt, arg1, arg2 ) #define Log3( level, severity, fmt, arg1, arg2, arg3 )