Changeset 1407 for trunk/psLib/src/sys/psTrace.h
- Timestamp:
- Aug 6, 2004, 2:06:06 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psTrace.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psTrace.h
r1393 r1407 1 1 2 /** @file psTrace.h 2 3 * \brief basic run-time trace facilities … … 9 10 * @author George Gusciora, MHPCC 10 11 * 11 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-08-0 5 19:38:52$12 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-07 00:06:06 $ 13 14 * 14 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 15 16 */ 16 17 #if !defined(PS_TRACE_H) 17 # define PS_TRACE_H 118 # define PS_TRACE_H 1 18 19 19 #define PS_UNKNOWN_TRACE_LEVEL -9999 // we don't know this name's level 20 #define PS_DEFAULT_TRACE_LEVEL 0 21 20 # define PS_UNKNOWN_TRACE_LEVEL -9999 // we don't know this name's level 21 # define PS_DEFAULT_TRACE_LEVEL 0 22 22 23 23 /** \addtogroup LogTrace … … 29 29 //#define PS_NO_TRACE 1 ///< to turn off all tracing 30 30 31 #if defined(PS_NO_TRACE) 32 #define psTrace(facil, level, ...) (void)0 /* do nothing */ 33 #define p_psTrace(facil, level, ...) (void)0 /* do nothing */ 34 #define psTraceSetLevel(facil,level) 0 35 #define psTraceGetLevel(facil) 0 36 #define psTraceReset() (void)0 /* do nothing */ 37 #define psTraceFree() (void)0 /* do nothing */ 38 #define psTracePrintLevels() (void)0 /* do nothing */ 39 #define psTraceSetDestination(fp) (void)0 /* do nothing */ 40 #else 31 # if defined(PS_NO_TRACE) 32 # define psTrace(facil, level, ...) (void)0 33 /* do nothing */ 34 # define p_psTrace(facil, level, ...) (void)0 35 /* do nothing */ 36 # define psTraceSetLevel(facil,level) 0 37 # define psTraceGetLevel(facil) 0 38 # define psTraceReset() (void)0 /* do nothing */ 39 # define psTraceFree() (void)0 /* do nothing */ 40 # define psTracePrintLevels() (void)0 41 /* do nothing */ 42 # define psTraceSetDestination(fp) (void)0 43 /* do nothing */ 44 # else 41 45 42 /** Basic structure for the component tree. A component is a string of the43 form aaa.bbb.ccc, and may itself contain further subcomponents. The44 Component structure doesn't in fact contain it's full name, but only the45 last part. */46 typedef struct p_psComponent47 {48 const char *name;// last part of name of component49 int level;// trace level for this component50 int n;// number of subcomponents51 struct p_psComponent **subcomp;// next level of subcomponents52 }46 /** Basic structure for the component tree. A component is a string of the 47 form aaa.bbb.ccc, and may itself contain further subcomponents. The 48 Component structure doesn't in fact contain it's full name, but only the 49 last part. */ 50 typedef struct p_psComponent 51 { 52 const char *name; // last part of name of component 53 int level; // trace level for this component 54 int n; // number of subcomponents 55 struct p_psComponent **subcomp; // next level of subcomponents 56 } 53 57 p_psComponent; 54 58 55 # ifndef DOXYGEN59 # ifndef DOXYGEN 56 60 /// Send a trace message 57 void p_psTrace(const char *facil, ///< facilty of interest58 int myLevel, ///< desired trace level59 ...) ///< trace message arguments61 void p_psTrace(const char *facil, // /< facilty of interest 62 int myLevel, // /< desired trace level 63 ...) // /< trace message arguments 60 64 ; 61 # endif65 # endif 62 66 63 67 /// Set trace level 64 int psTraceSetLevel(const char *facil, ///< facilty of interest65 int level) ///< desired trace level68 int psTraceSetLevel(const char *facil, // /< facilty of interest 69 int level) // /< desired trace level 66 70 ; 67 71 68 72 /// Get the trace level 69 int psTraceGetLevel(const char *facil) ///< facilty of interest73 int psTraceGetLevel(const char *facil) // /< facilty of interest 70 74 ; 71 75 72 76 /// Set all trace levels to zero (do not free nodes in the component tree). 73 void psTraceReset() 74 ; 77 void psTraceReset(); 75 78 76 79 /// Free all nodes in the component tree. 77 void psTraceFree() 78 ; 80 void psTraceFree(); 79 81 80 82 /// print trace levels 81 void psTracePrintLevels(void) 82 ; 83 void psTracePrintLevels(void); 83 84 84 85 /// Set the destination of future trace messages. 85 void psTraceSetDestination(FILE * fp);86 void psTraceSetDestination(FILE * fp); 86 87 88 /* \} */// End of SystemGroup Functions 87 89 88 /* \} */ // End of SystemGroup Functions 89 90 #define psTrace(facil, level, ...) p_psTrace(facil, level, __VA_ARGS__) 91 #endif 90 # define psTrace(facil, level, ...) p_psTrace(facil, level, __VA_ARGS__) 91 # endif 92 92 93 93 #endif 94
Note:
See TracChangeset
for help on using the changeset viewer.
