-# endif
-
-#else /* LDAP_DEBUG */
-# define Debug( level, fmt, arg1, arg2, arg3 )
-
-#endif /* LDAP_DEBUG */
-
-#ifdef NEW_LOGGING
-extern int ldap_loglevels[LDAP_SUBSYS_NUM];
-
-#ifdef LDAP_DEBUG
-
-#define LDAP_LOG(a, b, fmt, arg1, arg2, arg3) do {\
- if (ldap_loglevels[LDAP_SUBSYS_##a] >= LDAP_LEVEL_##b || \
- ldap_loglevels[LDAP_SUBSYS_GLOBAL] >= LDAP_LEVEL_##b)\
- lutil_log (LDAP_SUBSYS_##a, LDAP_LEVEL_##b, fmt, arg1, arg2, arg3); \
- } while (0)
-
-
-#define LDAP_LOGS_TEST(a, b) \
- (ldap_loglevels[LDAP_SUBSYS_##a] >= LDAP_LEVEL_##b || \
- ldap_loglevels[LDAP_SUBSYS_GLOBAL] >= LDAP_LEVEL_##b)
-
-#endif /* LDAP_DEBUG */
-
-#endif /* NEW_LOGGING */
-
-#ifndef LDAP_LOG
-#define LDAP_LOG(a, b, fmt, arg1, arg2, arg3)
-#define LDAP_LOGS_TEST(a, b) 0
-#endif
-
-LDAP_LUTIL_F(int) lutil_mnem2level LDAP_P(( const char *level ));
-LDAP_LUTIL_F(void) lutil_log_initialize LDAP_P((
- int argc, char **argv ));
-LDAP_LUTIL_F(int) lutil_set_debug_level LDAP_P((
- const char *subsys, int level ));
-LDAP_LUTIL_F(void) lutil_log LDAP_P((
- const int subsys, int level, const char *fmt, ... ));
+#define Log4( level, severity, fmt, arg1, arg2, arg3, arg4 ) \
+ do { \
+ if ( ldap_debug & (level) ) \
+ lutil_debug( ldap_debug, (level), (fmt), (arg1), (arg2), (arg3), (arg4) ); \
+ } while ( 0 )
+#define Log5( level, severity, fmt, arg1, arg2, arg3, arg4, arg5 ) \
+ do { \
+ if ( ldap_debug & (level) ) \
+ lutil_debug( ldap_debug, (level), (fmt), (arg1), (arg2), (arg3), (arg4), (arg5) ); \
+ } while ( 0 )
+#define Debug( 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 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 */