#ifndef TRACE_H #define TRACE_H //------------------------------------------------------------------------------ // Headers //------------------------------------------------------------------------------ //----------------------------------------------------------------------------- // configure print message level here //----------------------------------------------------------------------------- #define TRACE_LEVEL TRACE_LEVEL_INFO //------------------------------------------------------------------------------ // Global Definitions //------------------------------------------------------------------------------ #define TRACE_LEVEL_DEBUG 5 #define TRACE_LEVEL_INFO 4 #define TRACE_LEVEL_WARNING 3 #define TRACE_LEVEL_ERROR 2 #define TRACE_LEVEL_FATAL 1 #define TRACE_LEVEL_NO_TRACE 0 // Trace compilation depends on TRACE_LEVEL value #if (TRACE_LEVEL >= TRACE_LEVEL_DEBUG) #define TRACE_DEBUG(...) { UMFDBG(0,"\n-DEBUG-\n " __VA_ARGS__); } #else #define TRACE_DEBUG(...) { } #endif #if (TRACE_LEVEL >= TRACE_LEVEL_INFO) #define TRACE_INFO(...) { UMFDBG(0,"\n-INFO-\n " __VA_ARGS__); } #else #define TRACE_INFO(...) { } #endif #if (TRACE_LEVEL >= TRACE_LEVEL_WARNING) #define TRACE_WARNING(...) { UMFDBG(0,"\n-WARNING-\n " __VA_ARGS__); } #else #define TRACE_WARNING(...) { } #endif #if (TRACE_LEVEL >= TRACE_LEVEL_ERROR) #define TRACE_ERROR(...) { UMFDBG(0,"\n-ERROR-\n " __VA_ARGS__); } #else #define TRACE_ERROR(...) { } #endif #if (TRACE_LEVEL >= TRACE_LEVEL_FATAL) #define TRACE_FATAL(...) { UMFDBG(0,"\n-FATAL-\n " __VA_ARGS__); while(1); } #else #define TRACE_FATAL(...) { while(1); } #endif #endif //#ifndef TRACE_H