Changeset 15 for trunk/IPs/systemC/processor/Morpheo/Include/Debug.h
- Timestamp:
- Apr 5, 2007, 4:17:30 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Include/Debug.h
r3 r15 9 9 #include <string> 10 10 using namespace std; 11 12 // Debug's Level : 13 // * None : print elementary information 14 // * Info : print basic information 15 // * Trace : trace internal variable 16 // * Func : trace call and return function 17 // * All : print all information 11 18 12 19 enum _debug_verbosity … … 21 28 #ifdef DEBUG 22 29 //Debug 23 /* 24 # define log_printf(level, component, str... ) \ 25 do \ 26 { \ 27 if ( ( DEBUG_ ## level <= DEBUG) and \ 28 ( DEBUG_ ## component == true ) ) \ 29 { \ 30 fprintf(stdout,"<%s> line %d : ",__FILE__,__LINE__); \ 31 fprintf(stdout,str); \ 32 fprintf(stdout,"\n"); \ 33 } \ 34 } while(0) 35 */ 36 37 # define log_printf(level, component, func, str... ) \ 38 do \ 39 { \ 40 if ( ( DEBUG_ ## level <= DEBUG) and \ 41 ( DEBUG_ ## component == true ) ) \ 42 { \ 43 fprintf(stdout,"In file %s, ",__FILE__); \ 44 fprintf(stdout,"at line %d, ",__LINE__); \ 45 fprintf(stdout,"in function \"%s\" : ",func); \ 46 fprintf(stdout,str); \ 47 fprintf(stdout,"\n"); \ 48 } \ 30 31 # define log_printf(level, component, func, str... ) \ 32 do \ 33 { \ 34 if ( (DEBUG == DEBUG_ALL) or \ 35 (( DEBUG_ ## level <= DEBUG) and \ 36 ( DEBUG_ ## component == true )) ) \ 37 { \ 38 if (DEBUG >= DEBUG_ALL ) \ 39 { \ 40 switch (DEBUG_ ## level) \ 41 { \ 42 case DEBUG_NONE : fprintf(stdout,"(none ) "); break; \ 43 case DEBUG_INFO : fprintf(stdout,"(information) "); break; \ 44 case DEBUG_TRACE : fprintf(stdout,"(trace ) "); break; \ 45 case DEBUG_FUNC : fprintf(stdout,"(function ) "); break; \ 46 case DEBUG_ALL : fprintf(stdout,"(all ) "); break; \ 47 default : fprintf(stdout,"(undefine ) "); break; \ 48 } \ 49 } \ 50 fprintf(stdout,"In file %s, ",__FILE__); \ 51 fprintf(stdout,"at line %d, ",__LINE__); \ 52 if (DEBUG >= DEBUG_FUNC) \ 53 { \ 54 fprintf(stdout,"in function \"%s\" ",func); \ 55 } \ 56 fprintf(stdout,": "); \ 57 fprintf(stdout,str); \ 58 fprintf(stdout,"\n"); \ 59 fflush (stdout); \ 60 } \ 49 61 } while(0) 50 62 51 63 #else 52 64 // No debug 53 /* 54 # define log_printf(level, component, str... ) \ 55 do \ 56 { \ 57 } while(0) 58 */ 65 59 66 # define log_printf(level, component, func, str... ) \ 60 67 do \
Note: See TracChangeset
for help on using the changeset viewer.