ldaplog.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  3. * Copyright (C) 2005 Red Hat, Inc.
  4. * All rights reserved.
  5. *
  6. * License: GPL (version 3 or any later version).
  7. * See LICENSE for details.
  8. * END COPYRIGHT BLOCK **/
  9. #ifdef HAVE_CONFIG_H
  10. # include <config.h>
  11. #endif
  12. #ifndef _LDAPLOG_H
  13. #define _LDAPLOG_H
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. #define LDAP_DEBUG_TRACE 0x000001 /* 1 */
  18. #define LDAP_DEBUG_PACKETS 0x000002 /* 2 */
  19. #define LDAP_DEBUG_ARGS 0x000004 /* 4 */
  20. #define LDAP_DEBUG_CONNS 0x000008 /* 8 */
  21. #define LDAP_DEBUG_BER 0x000010 /* 16 */
  22. #define LDAP_DEBUG_FILTER 0x000020 /* 32 */
  23. #define LDAP_DEBUG_CONFIG 0x000040 /* 64 */
  24. #define LDAP_DEBUG_ACL 0x000080 /* 128 */
  25. #define LDAP_DEBUG_STATS 0x000100 /* 256 */
  26. #define LDAP_DEBUG_STATS2 0x000200 /* 512 */
  27. #define LDAP_DEBUG_SHELL 0x000400 /* 1024 */
  28. #define LDAP_DEBUG_PARSE 0x000800 /* 2048 */
  29. #define LDAP_DEBUG_HOUSE 0x001000 /* 4096 */
  30. #define LDAP_DEBUG_REPL 0x002000 /* 8192 */
  31. #define LDAP_DEBUG_ANY 0x004000 /* 16384 */
  32. #define LDAP_DEBUG_CACHE 0x008000 /* 32768 */
  33. #define LDAP_DEBUG_PLUGIN 0x010000 /* 65536 */
  34. #define LDAP_DEBUG_TIMING 0x020000 /* 131072 */
  35. #define LDAP_DEBUG_ACLSUMMARY 0x040000 /* 262144 */
  36. #define LDAP_DEBUG_BACKLDBM 0x080000 /* 524288 */
  37. #define LDAP_DEBUG_NUNCSTANS 0x100000 /* 1048576 */
  38. #define LDAP_DEBUG_ALL_LEVELS 0xFFFFFF
  39. /* debugging stuff */
  40. /* Disable by default */
  41. #define LDAPDebug( level, fmt, arg1, arg2, arg3 )
  42. #define LDAPDebugLevelIsSet( level ) (0)
  43. #define LDAPDebug0Args( level, fmt )
  44. #define LDAPDebug1Arg( level, fmt, arg )
  45. #define LDAPDebug2Args( level, fmt, arg1, arg2 )
  46. #ifdef LDAP_DEBUG
  47. # undef LDAPDebug
  48. # undef LDAPDebug0Args
  49. # undef LDAPDebug1Arg
  50. # undef LDAPDebug2Args
  51. # undef LDAPDebugLevelIsSet
  52. extern int slapd_ldap_debug;
  53. # define LDAPDebug( level, fmt, arg1, arg2, arg3 ) \
  54. { \
  55. if ( slapd_ldap_debug & level ) { \
  56. slapd_log_error_proc( NULL, fmt, arg1, arg2, arg3 ); \
  57. } \
  58. }
  59. # define LDAPDebug0Args( level, fmt ) \
  60. { \
  61. if ( slapd_ldap_debug & level ) { \
  62. slapd_log_error_proc( NULL, fmt ); \
  63. } \
  64. }
  65. # define LDAPDebug1Arg( level, fmt, arg ) \
  66. { \
  67. if ( slapd_ldap_debug & level ) { \
  68. slapd_log_error_proc( NULL, fmt, arg ); \
  69. } \
  70. }
  71. # define LDAPDebug2Args( level, fmt, arg1, arg2 ) \
  72. { \
  73. if ( slapd_ldap_debug & level ) { \
  74. slapd_log_error_proc( NULL, fmt, arg1, arg2 ); \
  75. } \
  76. }
  77. # define LDAPDebugLevelIsSet( level ) (0 != (slapd_ldap_debug & level))
  78. #endif /* LDAP_DEBUG */
  79. #ifdef __cplusplus
  80. }
  81. #endif
  82. #endif /* _LDAP_H */