tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native/common jk_logger.h
Date Fri, 12 Nov 2004 12:41:41 GMT
mturk       2004/11/12 04:41:41

  Modified:    jk/native/common jk_logger.h
  Log:
  Allow tracing without defining maintainer-mode.
  
  Revision  Changes    Path
  1.17      +20 -9     jakarta-tomcat-connectors/jk/native/common/jk_logger.h
  
  Index: jk_logger.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_logger.h,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- jk_logger.h	11 Nov 2004 17:02:25 -0000	1.16
  +++ jk_logger.h	12 Nov 2004 12:41:41 -0000	1.17
  @@ -84,17 +84,28 @@
   
   #define JK_LOG_REQUEST __FILE__,0,NULL,JK_LOG_REQUEST_LEVEL
   
  -/* Debug level is compile time only 
  +#if defined(JK_PRODUCTION)
  +/* TODO: all DEBUG messages should be compiled out
  + * when this define is in place.
    */
  -#if defined (DEBUG) || defined(_DEBUG)
  -#define JK_TRACE    1
  -#define JK_TRACE_ENTER(l) jk_log((l), JK_LOG_TRACE, "enter\n")
  -#define JK_TRACE_EXIT(l)  jk_log((l), JK_LOG_TRACE, "exit\n")
  -#else
  -#define JK_TRACE    0
  +#define JK_IS_PRODUCTION    1
   #define JK_TRACE_ENTER(l)
   #define JK_TRACE_EXIT(l)
  -#endif
  +#else
  +#define JK_IS_PRODUCTION    0
  +#define JK_TRACE_ENTER(l)                               \
  +    do {                                                \
  +        if ((l) && (l)->level == JK_LOG_TRACE_LEVEL) {  \
  +            jk_log((l), JK_LOG_TRACE, "enter\n");       \
  +    } } while (0)
  +
  +#define JK_TRACE_EXIT(l)                                \
  +    do {                                                \
  +        if ((l) && (l)->level == JK_LOG_TRACE_LEVEL) {  \
  +            jk_log((l), JK_LOG_TRACE, "exit\n");        \
  +    } } while (0)
  +
  +#endif  /* JK_PRODUCTION */
   
   #define JK_LOG_NULL_PARAMS(l) jk_log((l), JK_LOG_ERROR, "NULL parameters\n")
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message