]> git.sur5r.net Git - openldap/blobdiff - include/ldap_log.h
Added LDAP_LOG messages
[openldap] / include / ldap_log.h
index 6cb34d5cc4d38774a7efe253abfab1bda4cb2279..30f57c418c268304ba8766136d0b3a6f73cdd4d6 100644 (file)
@@ -1,6 +1,6 @@
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-2001 The OpenLDAP Foundation, Redwood City, California, USA
+ * Copyright 1998-2002 The OpenLDAP Foundation, Redwood City, California, USA
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -111,14 +111,18 @@ LDAP_BEGIN_DECL
 #   ifdef LDAP_SYSLOG
 #   define Debug( level, fmt, arg1, arg2, arg3 )       \
        do { \
-               lutil_debug( ldap_debug, (level), (fmt), (arg1), (arg2), (arg3) ); \
+               if ( ldap_debug & (level) ) \
+                       lutil_debug( ldap_debug, (level), (fmt), (arg1), (arg2), (arg3) ); \
                if ( ldap_syslog & (level) ) \
                        syslog( ldap_syslog_level, (fmt), (arg1), (arg2), (arg3) ); \
        } while ( 0 )
 
 #   else
 #       define Debug( level, fmt, arg1, arg2, arg3 ) \
-           lutil_debug( ldap_debug, (level), (fmt), (arg1), (arg2), (arg3) )
+       do { \
+               if ( ldap_debug & (level) ) \
+                       lutil_debug( ldap_debug, (level), (fmt), (arg1), (arg2), (arg3) ); \
+       } while ( 0 )
 #   endif
 
 #ifndef LDAP_LOG
@@ -135,10 +139,13 @@ LDAP_BEGIN_DECL
 #endif /* LDAP_DEBUG */
 
 
-LDAP_LUTIL_F(int) lutil_mnem2level LDAP_P(( char *level ));
-LDAP_LUTIL_F(void) lutil_log_initialize(int argc, char **argv);
-LDAP_LUTIL_F(void) lutil_set_debug_level LDAP_P(( char *subsys, int level ));
-LDAP_LUTIL_F(void) lutil_log LDAP_P(( char *subsys, int level, const char *fmt, ... ));
+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(void) lutil_set_debug_level LDAP_P((
+       const char *subsys, int level ));
+LDAP_LUTIL_F(void) lutil_log LDAP_P((
+       const char *subsys, int level, const char *fmt, ... ));
 
 LDAP_LUTIL_F(int) lutil_debug_file LDAP_P(( FILE *file ));