Back to index

lightning-sunbird  0.9+nobinonly
ldaplog.h
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is Mozilla Communicator client code, released
00015  * March 31, 1998.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998-1999
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #ifndef _LDAPLOG_H
00039 #define _LDAPLOG_H
00040 
00041 #ifdef __cplusplus
00042 extern "C" {
00043 #endif
00044 
00045 #define LDAP_DEBUG_TRACE    0x00001
00046 #define LDAP_DEBUG_PACKETS  0x00002
00047 #define LDAP_DEBUG_ARGS            0x00004
00048 #define LDAP_DEBUG_CONNS    0x00008
00049 #define LDAP_DEBUG_BER             0x00010
00050 #define LDAP_DEBUG_FILTER   0x00020
00051 #define LDAP_DEBUG_CONFIG   0x00040
00052 #define LDAP_DEBUG_ACL             0x00080
00053 #define LDAP_DEBUG_STATS    0x00100
00054 #define LDAP_DEBUG_STATS2   0x00200
00055 #define LDAP_DEBUG_SHELL    0x00400
00056 #define LDAP_DEBUG_PARSE    0x00800
00057 #define LDAP_DEBUG_HOUSE        0x01000
00058 #define LDAP_DEBUG_REPL         0x02000
00059 #define LDAP_DEBUG_ANY          0x04000
00060 #define LDAP_DEBUG_CACHE        0x08000
00061 #define LDAP_DEBUG_PLUGIN   0x10000
00062 
00063 /* debugging stuff */
00064 /* Disable by default */
00065 #define LDAPDebug( level, fmt, arg1, arg2, arg3 )
00066 
00067 #ifdef LDAP_DEBUG
00068 #  undef LDAPDebug
00069 
00070 /* SLAPD_LOGGING should not be on for WINSOCK (16-bit Windows) */
00071 #  if defined(SLAPD_LOGGING)
00072 #    ifdef _WIN32
00073        extern int    *module_ldap_debug;
00074 #      define LDAPDebug( level, fmt, arg1, arg2, arg3 ) \
00075        { \
00076               if ( *module_ldap_debug & level ) { \
00077                       slapd_log_error_proc( NULL, fmt, arg1, arg2, arg3 ); \
00078            } \
00079        }
00080 #    else /* _WIN32 */
00081        extern int    ldap_debug;
00082 #      define LDAPDebug( level, fmt, arg1, arg2, arg3 ) \
00083        { \
00084               if ( ldap_debug & level ) { \
00085                       slapd_log_error_proc( NULL, fmt, arg1, arg2, arg3 ); \
00086            } \
00087        }
00088 #    endif /* Win32 */
00089 #  else /* no SLAPD_LOGGING */
00090      extern void ber_err_print( char * );
00091      extern int      ldap_debug;
00092 #    define LDAPDebug( level, fmt, arg1, arg2, arg3 ) \
00093               if ( ldap_debug & level ) { \
00094                      char msg[256]; \
00095                      sprintf( msg, fmt, arg1, arg2, arg3 ); \
00096                      ber_err_print( msg ); \
00097               }
00098 #  endif /* SLAPD_LOGGING */
00099 #endif /* LDAP_DEBUG */
00100 
00101 #ifdef __cplusplus
00102 }
00103 #endif
00104 
00105 #endif /* _LDAP_H */