]> git.sur5r.net Git - openldap/blobdiff - include/ldap_log.h
misc doc fixes
[openldap] / include / ldap_log.h
index 84f886e324c99a45ed2a7ea66cb930ef08f1cf4f..ca8274c241df125d7f88216977f0ebbe637351a7 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  * 
- * Copyright 1998-2005 The OpenLDAP Foundation.
+ * Copyright 1998-2007 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -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) ) \
@@ -214,18 +226,19 @@ extern void eb_syslog(int pri, const char *fmt, ...);
                        lutil_debug( ldap_debug, (level), (fmt), (arg1), (arg2), (arg3), (arg4), (arg5) ); \
        } while ( 0 )
 #define Debug( level, fmt, arg1, arg2, arg3 ) \
-               Log3( (level), (fmt), (arg1), (arg2), (arg3) )
+               Log3( (level), 0, (fmt), (arg1), (arg2), (arg3) )
 #define LogTest(level) ( ldap_debug & (level) )
 #endif /* ! LDAP_SYSLOG */
 #else /* ! LDAP_DEBUG */
 /* TODO: in case LDAP_DEBUG is undefined, make sure logs with appropriate
  * severity gets thru anyway */
-#define Log1( level, severity, fmt, arg1 )
-#define Log2( level, severity, fmt, arg1, arg2 )
-#define Log3( level, severity, fmt, arg1, arg2, arg3 )
-#define Log4( level, severity, fmt, arg1, arg2, arg3, arg4 )
-#define Log5( level, severity, fmt, arg1, arg2, arg3, arg4, arg5 )
-#define Debug( level, fmt, arg1, arg2, arg3 )
+#define Log0( level, severity, fmt ) ((void)0)
+#define Log1( level, severity, fmt, arg1 ) ((void)0)
+#define Log2( level, severity, fmt, arg1, arg2 ) ((void)0)
+#define Log3( level, severity, fmt, arg1, arg2, arg3 ) ((void)0)
+#define Log4( level, severity, fmt, arg1, arg2, arg3, arg4 ) ((void)0)
+#define Log5( level, severity, fmt, arg1, arg2, arg3, arg4, arg5 ) ((void)0)
+#define Debug( level, fmt, arg1, arg2, arg3 ) ((void)0)
 #define LogTest(level) ( 0 )
 #endif /* ! LDAP_DEBUG */