Diff for /include/ldap_log.h between versions 1.40.2.4 and 1.50

version 1.40.2.4, 2007/08/31 23:13:53 version 1.50, 2011/01/04 23:42:57
Line 1 Line 1
 /* $OpenLDAP: pkg/ldap/include/ldap_log.h,v 1.43 2007/01/02 19:00:56 kurt Exp $ */  /* $OpenLDAP: pkg/ldap/include/ldap_log.h,v 1.49 2010/04/13 20:17:49 kurt Exp $ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.  /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *    * 
  * Copyright 1998-2007 The OpenLDAP Foundation.   * Copyright 1998-2011 The OpenLDAP Foundation.
  * All rights reserved.   * All rights reserved.
  *   *
  * Redistribution and use in source and binary forms, with or without   * Redistribution and use in source and binary forms, with or without
Line 123  LDAP_BEGIN_DECL Line 123  LDAP_BEGIN_DECL
 #define LDAP_DEBUG_SYNC         0x4000  #define LDAP_DEBUG_SYNC         0x4000
   
 #define LDAP_DEBUG_NONE         0x8000  #define LDAP_DEBUG_NONE         0x8000
 #define LDAP_DEBUG_ANY          -1  #define LDAP_DEBUG_ANY          (-1)
   
 /* debugging stuff */  /* debugging stuff */
 #ifdef LDAP_DEBUG  #ifdef LDAP_DEBUG
Line 148  extern void eb_syslog(int pri, const cha Line 148  extern void eb_syslog(int pri, const cha
   
 /* this doesn't below as part of ldap.h */  /* this doesn't below as part of ldap.h */
 #ifdef LDAP_SYSLOG  #ifdef LDAP_SYSLOG
 #define Log0( level, severity, fmt )    \  
         do { \  #define LogTest(level) ( ( ldap_debug | ldap_syslog ) & (level) )
                 if ( ldap_debug & (level) ) \  #define LogExpand(level, severity, args) \
                         lutil_debug( ldap_debug, (level), (fmt) ); \  
                 if ( ldap_syslog & (level) ) \  
                         syslog( LDAP_LEVEL_MASK((severity)), (fmt) ); \  
         } while ( 0 )  
 #define Log1( level, severity, fmt, arg1 )      \  
         do { \  
                 if ( ldap_debug & (level) ) \  
                         lutil_debug( ldap_debug, (level), (fmt), (arg1) ); \  
                 if ( ldap_syslog & (level) ) \  
                         syslog( LDAP_LEVEL_MASK((severity)), (fmt), (arg1) ); \  
         } while ( 0 )  
 #define Log2( level, severity, fmt, arg1, arg2 ) \  
         do { \  
                 if ( ldap_debug & (level) ) \  
                         lutil_debug( ldap_debug, (level), (fmt), (arg1), (arg2) ); \  
                 if ( ldap_syslog & (level) ) \  
                         syslog( LDAP_LEVEL_MASK((severity)), (fmt), (arg1), (arg2) ); \  
         } while ( 0 )  
 #define Log3( level, severity, fmt, arg1, arg2, arg3 ) \  
         do { \  
                 if ( ldap_debug & (level) ) \  
                         lutil_debug( ldap_debug, (level), (fmt), (arg1), (arg2), (arg3) ); \  
                 if ( ldap_syslog & (level) ) \  
                         syslog( LDAP_LEVEL_MASK((severity)), (fmt), (arg1), (arg2), (arg3) ); \  
         } while ( 0 )  
 #define Log4( level, severity, fmt, arg1, arg2, arg3, arg4 ) \  
         do { \  
                 if ( ldap_debug & (level) ) \  
                         lutil_debug( ldap_debug, (level), (fmt), (arg1), (arg2), (arg3), (arg4) ); \  
                 if ( ldap_syslog & (level) ) \  
                         syslog( LDAP_LEVEL_MASK((severity)), (fmt), (arg1), (arg2), (arg3), (arg4) ); \  
         } while ( 0 )  
 #define Log5( level, severity, fmt, arg1, arg2, arg3, arg4, arg5 ) \  
         do { \          do { \
                 if ( ldap_debug & (level) ) \                  if ( ldap_debug & (level) ) \
                         lutil_debug( ldap_debug, (level), (fmt), (arg1), (arg2), (arg3), (arg4), (arg5) ); \                          lutil_debug( ldap_debug, (level), args ); \
                 if ( ldap_syslog & (level) ) \                  if ( ldap_syslog & (level) ) \
                         syslog( LDAP_LEVEL_MASK((severity)), (fmt), (arg1), (arg2), (arg3), (arg4), (arg5) ); \                          syslog( LDAP_LEVEL_MASK((severity)), args ); \
         } while ( 0 )          } while ( 0 )
 #define Debug( level, fmt, arg1, arg2, arg3 )   \  
         Log3( (level), ldap_syslog_level, (fmt), (arg1), (arg2), (arg3) )  
 #define LogTest(level) ( ( ldap_debug | ldap_syslog ) & (level) )  
   
 #else /* ! LDAP_SYSLOG */  #else /* ! LDAP_SYSLOG */
 #define Log0( level, severity, fmt ) \  
         do { \  #define LogTest(level) ( ldap_debug & (level) )
                 if ( ldap_debug & (level) ) \  #define LogExpand(level, severity, args) \
                         lutil_debug( ldap_debug, (level), (fmt) ); \  
         } while ( 0 )  
 #define Log1( level, severity, fmt, arg1 ) \  
         do { \  
                 if ( ldap_debug & (level) ) \  
                         lutil_debug( ldap_debug, (level), (fmt), (arg1) ); \  
         } while ( 0 )  
 #define Log2( level, severity, fmt, arg1, arg2 ) \  
         do { \  
                 if ( ldap_debug & (level) ) \  
                         lutil_debug( ldap_debug, (level), (fmt), (arg1), (arg2) ); \  
         } while ( 0 )  
 #define Log3( level, severity, fmt, arg1, arg2, arg3 ) \  
         do { \  
                 if ( ldap_debug & (level) ) \  
                         lutil_debug( ldap_debug, (level), (fmt), (arg1), (arg2), (arg3) ); \  
         } while ( 0 )  
 #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 { \          do { \
                 if ( ldap_debug & (level) ) \                  if ( ldap_debug & (level) ) \
                         lutil_debug( ldap_debug, (level), (fmt), (arg1), (arg2), (arg3), (arg4), (arg5) ); \                          lutil_debug( ldap_debug, (level), args ); \
         } while ( 0 )          } 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 */  #endif /* ! LDAP_SYSLOG */
 #else /* ! LDAP_DEBUG */  #else /* ! LDAP_DEBUG */
   
 /* TODO: in case LDAP_DEBUG is undefined, make sure logs with appropriate  /* TODO: in case LDAP_DEBUG is undefined, make sure logs with appropriate
  * severity gets thru anyway */   * 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 )  #define LogTest(level) ( 0 )
   #define LogExpand(level, severity, args) ((void) 0)
   
 #endif /* ! LDAP_DEBUG */  #endif /* ! LDAP_DEBUG */
   
   #define LogArg ,
   #define Log0(level, severity, fmt) \
           LogExpand((level), (severity), (fmt))
   #define Log1(level, severity, fmt, a1) \
           LogExpand((level), (severity), (fmt) LogArg(a1))
   #define Log2(level, severity, fmt, a1, a2) \
           LogExpand((level), (severity), (fmt) LogArg(a1) LogArg(a2))
   #define Log3(level, severity, fmt, a1, a2, a3) \
           LogExpand((level), (severity), (fmt) LogArg(a1) LogArg(a2) LogArg(a3))
   #define Log4(level, severity, fmt, a1, a2, a3, a4) \
           LogExpand((level), (severity), (fmt) LogArg(a1) LogArg(a2) LogArg(a3) \
                   LogArg(a4))
   #define Log5(level, severity, fmt, a1, a2, a3, a4, a5) \
           LogExpand((level), (severity), (fmt) LogArg(a1) LogArg(a2) LogArg(a3) \
                   LogArg(a4) LogArg(a5))
   #define Debug(level, fmt, a1, a2, a3) \
           LogExpand((level), ldap_syslog_level, (fmt) \
                   LogArg(a1) LogArg(a2) LogArg(a3))
   
 LDAP_LUTIL_F(int) lutil_debug_file LDAP_P(( FILE *file ));  LDAP_LUTIL_F(int) lutil_debug_file LDAP_P(( FILE *file ));
   
 LDAP_LUTIL_F(void) lutil_debug LDAP_P((  LDAP_LUTIL_F(void) lutil_debug LDAP_P((

Removed from v.1.40.2.4  
changed lines
  Added in v.1.50


______________
© Copyright 1998-2020, OpenLDAP Foundation, info@OpenLDAP.org