home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / pp / pp-6.0 / h / ll_log.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-18  |  2.6 KB  |  129 lines

  1. /* ll_log.h: logging definitions */
  2.  
  3. /*
  4.  * @(#) $Header: /xtel/pp/pp-beta/h/RCS/ll_log.h,v 6.0 1991/12/18 20:42:44 jpo Rel $
  5.  *
  6.  * $Log: ll_log.h,v $
  7.  * Revision 6.0  1991/12/18  20:42:44  jpo
  8.  * Release 6.0
  9.  *
  10.  *
  11.  */
  12.  
  13.  
  14.  
  15. #ifndef _H_LOG_
  16. #define _H_LOG_
  17.  
  18.  
  19.  
  20. #include        <isode/logger.h>
  21.  
  22.  
  23. extern  LLog    *pp_log_norm,
  24.         *pp_log_stat,
  25.         *pp_log_oper;
  26.  
  27.  
  28. /* can't leave spaces in macro definitions... PP_LOG ( blows up! */
  29.  
  30. #define PP_LOG(level, args)    SLOG (pp_log_norm, level, NULLCP, args)
  31. #define PP_SLOG(level, str, args) \
  32.                 SLOG (pp_log_norm, level, str, args)
  33. #define PP_OPER(what, args)    if (pp_log_oper -> ll_events & (LLOG_FATAL)) { \
  34.     (void) ll_log (pp_log_oper, LLOG_FATAL, what, "%s", ll_preset args); \
  35.     (void) ll_log (pp_log_norm, LLOG_FATAL, what, "%s", ll_preset args); \
  36.     } \
  37.     else
  38. #define PP_STAT(args)        SLOG (pp_log_stat, LLOG_NOTICE, NULLCP, args)
  39. #define PP_NOTICE(args)        SLOG(pp_log_norm, LLOG_NOTICE, NULLCP, args)
  40.  
  41. /* Tracing of PP PDUS */
  42. #define PDU_READ    (1)
  43. #define PDU_WRITE    (0)
  44.  
  45. #if PP_DEBUG > 0 
  46.  
  47. #ifdef PEPSY_VERSION 
  48. #ifdef __STDC__
  49.  
  50. #define PP_PDUP(fnx,pe,text,rw) \
  51.     if (pp_log_norm -> ll_events & LLOG_PDUS) { \
  52.         pvpdu (pp_log_norm, print_##fnx##_P, pe, text, rw); \
  53. } \
  54. else
  55.  
  56. #define PP_PDU(fnx,pe,text,rw) \
  57.     if (pp_log_norm -> ll_events & LLOG_PDUS) { \
  58.         pvpdu (pp_log_norm, fnx##_P, pe, text, rw); \
  59. } \
  60. else
  61.  
  62. #else /* !STDC */
  63.  
  64. #define PP_PDUP(fnx,pe,text,rw) \
  65.     if (pp_log_norm -> ll_events & LLOG_PDUS) { \
  66.         pvpdu (pp_log_norm, print_/**/fnx/**/_P, pe, text, rw); \
  67. } \
  68. else
  69.  
  70. #define PP_PDU(fnx,pe,text,rw) \
  71.     if (pp_log_norm -> ll_events & LLOG_PDUS) { \
  72.         pvpdu (pp_log_norm, fnx/**/_P, pe, text, rw); \
  73. } \
  74. else
  75.  
  76. #endif /* STDC */
  77.  
  78. #else /* !PEPSY_VERSION */
  79.  
  80. #ifdef __STDC__
  81.  
  82. #define PP_PDUP(fnx,pe,text,rw)\
  83.     if (pp_log_norm -> ll_events & LLOG_PDUS) {\
  84.                vpdu (pp_log_norm, print_##fnx, pe, text, rw);\
  85. }\
  86. else
  87.  
  88. #else /* !__STDC__ */
  89.  
  90. #define PP_PDUP(fnx,pe,text,rw)\
  91.     if (pp_log_norm -> ll_events & LLOG_PDUS) {\
  92.                vpdu (pp_log_norm, print_/**/fnx, pe, text, rw);\
  93. }\
  94. else
  95.  
  96. #endif /* __STDC__ */
  97.  
  98. #define PP_PDU(fnx,pe,text,rw) \
  99.     if (pp_log_norm -> ll_events & LLOG_PDUS) { \
  100.         vpdu (pp_log_norm, fnx, pe, text, rw); \
  101. } \
  102. else
  103.  
  104. #endif /* PEPSY_VERSION */
  105.  
  106. #else /* !DEBUG */
  107.  
  108. #define PP_PDU(fnx,pe,text,rw)
  109. #define PP_PDUP(fnx,pe,text,rw)
  110.  
  111. #endif
  112.  
  113. /* general PP Tracing */
  114. #if PP_DEBUG > 0
  115. #define PP_TRACE(args)  SLOG (pp_log_norm, LLOG_TRACE, NULLCP, args)
  116. #else
  117. #define PP_TRACE(args)
  118. #endif
  119.  
  120.  
  121. /* Low level PP Tracing */
  122. #if PP_DEBUG > 1
  123. #define PP_DBG(args)    SLOG (pp_log_norm, LLOG_DEBUG, NULLCP, args)
  124. #else
  125. #define PP_DBG(args)
  126. #endif
  127.  
  128. #endif
  129.