ldaplog.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 0x00000001 /* 1 */
  18. #define LDAP_DEBUG_PACKETS 0x00000002 /* 2 */
  19. #define LDAP_DEBUG_ARGS 0x00000004 /* 4 */
  20. #define LDAP_DEBUG_CONNS 0x00000008 /* 8 */
  21. #define LDAP_DEBUG_BER 0x00000010 /* 16 */
  22. #define LDAP_DEBUG_FILTER 0x00000020 /* 32 */
  23. #define LDAP_DEBUG_CONFIG 0x00000040 /* 64 */
  24. #define LDAP_DEBUG_ACL 0x00000080 /* 128 */
  25. #define LDAP_DEBUG_STATS 0x00000100 /* 256 */
  26. #define LDAP_DEBUG_STATS2 0x00000200 /* 512 */
  27. #define LDAP_DEBUG_SHELL 0x00000400 /* 1024 */
  28. #define LDAP_DEBUG_PARSE 0x00000800 /* 2048 */
  29. #define LDAP_DEBUG_HOUSE 0x00001000 /* 4096 */
  30. #define LDAP_DEBUG_REPL 0x00002000 /* 8192 */
  31. #define LDAP_DEBUG_ANY 0x00004000 /* 16384 */
  32. #define LDAP_DEBUG_CACHE 0x00008000 /* 32768 */
  33. #define LDAP_DEBUG_PLUGIN 0x00010000 /* 65536 */
  34. #define LDAP_DEBUG_TIMING 0x00020000 /* 131072 */
  35. #define LDAP_DEBUG_ACLSUMMARY 0x00040000 /* 262144 */
  36. #define LDAP_DEBUG_BACKLDBM 0x00080000 /* 524288 */
  37. #define LDAP_DEBUG_NUNCSTANS 0x00100000 /* 1048576 */
  38. #define LDAP_DEBUG_EMERG 0x00200000 /* 2097152 */
  39. #define LDAP_DEBUG_ALERT 0x00400000 /* 4194304 */
  40. #define LDAP_DEBUG_CRIT 0x00800000 /* 8388608 */
  41. #define LDAP_DEBUG_ERR 0x01000000 /* 16777216 */
  42. #define LDAP_DEBUG_WARNING 0x02000000 /* 33554432 */
  43. #define LDAP_DEBUG_NOTICE 0x04000000 /* 67108864 */
  44. #define LDAP_DEBUG_INFO 0x08000000 /* 134217728 */
  45. #define LDAP_DEBUG_DEBUG 0x10000000 /* 268435456 */
  46. #define LDAP_DEBUG_ALL_LEVELS 0xFFFFFF
  47. /* debugging stuff */
  48. /* Disable by default */
  49. #define LDAPDebug( level, fmt, arg1, arg2, arg3 )
  50. #define LDAPDebugLevelIsSet( level ) (0)
  51. #define LDAPDebug0Args( level, fmt )
  52. #define LDAPDebug1Arg( level, fmt, arg )
  53. #define LDAPDebug2Args( level, fmt, arg1, arg2 )
  54. #ifdef LDAP_DEBUG
  55. # undef LDAPDebug
  56. # undef LDAPDebug0Args
  57. # undef LDAPDebug1Arg
  58. # undef LDAPDebug2Args
  59. # undef LDAPDebugLevelIsSet
  60. extern int slapd_ldap_debug;
  61. # define LDAPDebug( level, fmt, arg1, arg2, arg3 ) \
  62. { \
  63. if ( slapd_ldap_debug & level ) { \
  64. slapd_log_error_proc( level, NULL, fmt, arg1, arg2, arg3 ); \
  65. } \
  66. }
  67. # define LDAPDebug0Args( level, fmt ) \
  68. { \
  69. if ( slapd_ldap_debug & level ) { \
  70. slapd_log_error_proc( level, NULL, fmt ); \
  71. } \
  72. }
  73. # define LDAPDebug1Arg( level, fmt, arg ) \
  74. { \
  75. if ( slapd_ldap_debug & level ) { \
  76. slapd_log_error_proc( level, NULL, fmt, arg ); \
  77. } \
  78. }
  79. # define LDAPDebug2Args( level, fmt, arg1, arg2 ) \
  80. { \
  81. if ( slapd_ldap_debug & level ) { \
  82. slapd_log_error_proc( level, NULL, fmt, arg1, arg2 ); \
  83. } \
  84. }
  85. # define LDAPDebugLevelIsSet( level ) (0 != (slapd_ldap_debug & level))
  86. #endif /* LDAP_DEBUG */
  87. #ifdef __cplusplus
  88. }
  89. #endif
  90. #endif /* _LDAP_H */