1 //=============================================================================
3 // Created : mar jun 19 13:18:14 CEST 2001
4 // Author : Antoine YESSAYAN, Paul RASCLE, EDF
6 // Copyright : EDF 2001
8 //=============================================================================
10 /* --- Definition macros file to print informations if _DEBUG_ is defined --- */
18 //VRV: T2.4 - replacement macro for using special CORBA server
19 #include "SALOME_Trace.hxx"
20 //VRV: T2.4 - replacement macro for using special CORBA server
22 /* --- INFOS is always defined (without _DEBUG_): to be used for warnings, with release version --- */
24 //VRV: T2.4 - replacement of these macros for using special CORBA server
26 #define INFOS(msg) { GLogger.putMessage(GLogger << __FILE__<< " [" << __LINE__ << "] : " << msg<< endl << ends ); }
27 #define PYSCRIPT(msg) { GLogger.putMessage(GLogger<<"---PYSCRIPT--- "<<msg<<endl<<ends ); }
29 //# define HEREWEARE {cout<<flush ; cerr << __FILE__ << " [" << __LINE__ << "] : " << flush ;}
30 //# define INFOS(chain) {HEREWEARE ; cerr << chain << endl ;}
31 //# define PYSCRIPT(chain) {cout<<flush ; cerr << "---PYSCRIPT--- " << chain << endl ;}
33 //VRV: T2.4 - replacement of these macros for using special CORBA server
36 /* --- To print date and time of compilation of current source on stdout --- */
38 # if defined ( __GNUC__ )
39 # define COMPILER "g++"
40 # elif defined ( __sun )
41 # define COMPILER "CC"
42 # elif defined ( __KCC )
43 # define COMPILER "KCC"
44 # elif defined ( __PGI )
45 # define COMPILER "pgCC"
47 # define COMPILER "undefined"
50 # ifdef INFOS_COMPILATION
51 # error INFOS_COMPILATION already defined
54 //VRV: T2.4 - replacement macro for using special CORBA server
55 #define INFOS_COMPILATION { \
57 GLogger << __FILE__ << " [" << __LINE__ << "] : "\
58 << "COMPILED with " << COMPILER \
60 << " at " << __TIME__ << endl << endl <<endl<<ends); }
61 /* # define INFOS_COMPILATION {\ */
63 /* cout << __FILE__ ;\ */
64 /* cout << " [" << __LINE__ << "] : " ;\ */
65 /* cout << "COMPILED with " << COMPILER ;\ */
66 /* cout << ", " << __DATE__ ; \ */
67 /* cout << " at " << __TIME__ << endl ;\ */
68 /* cout << "\n\n" ;\ */
69 /* cout << flush ;\ */
71 //VRV: T2.4 - replacement macro for using special CORBA server
75 /* --- the following MACROS are useful at debug time --- */
77 //VRV: T2.4 - replacement of these macros for using special CORBA server
79 #define MYTRACE GLogger << "- Trace " << __FILE__ << " [" << __LINE__ << "] : "
81 #define MESSAGE(msg) { GLogger.putMessage( MYTRACE <<msg<<endl<<ends); }
82 #define SCRUTE(var) { GLogger.putMessage( MYTRACE << #var << "=" << var <<endl<<ends); }
84 #define REPERE GLogger << " --------------" << endl
85 #define BEGIN_OF(msg) {REPERE ; MYTRACE << "Begin of: " << msg << endl ; REPERE ; GLogger.putMessage(GLogger<<ends); }
86 #define END_OF(msg) {REPERE ; MYTRACE << "Normal end of: " << msg << endl ; REPERE ; GLogger.putMessage(GLogger<<ends); }
88 # define HERE {cout<<flush ; cerr << "- Trace " << __FILE__ << " [" << __LINE__ << "] : " << flush ;}
90 //VRV: T2.4 - replacement of these macros for using special CORBA server
92 # define INTERRUPTION(code) {HERE ; cerr << "INTERRUPTION return code= " << code << endl ; exit(code) ;}
95 # define ASSERT(condition) if (!(condition)){ HERE ; cerr << "CONDITION " << #condition << " NOT VERIFIED"<< endl ; INTERRUPTION(1) ;}
98 # else /* ifdef _DEBUG_*/
101 #define SCRUTE(var) {}
102 #define MESSAGE(msg) {}
104 #define BEGIN_OF(msg) {}
105 #define END_OF(msg) {}
107 # define INTERRUPTION(code) {}
110 # define ASSERT(condition) {}
115 # endif /* ifdef _DEBUG_*/
117 # endif /* ifndef UTILITIES_H */