00001 #if !defined(_DEV_HPP)
00002 #define _DEV_HPP
00003
00004
00005
00006
00007
00008
00009
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #include "config/config.hpp"
00043 #include "config/commonincs.hpp"
00044
00045
00046 static FILE* m_logout;
00047 class XDFLENGINE_EXPORT logstream
00048 {
00049 private:
00050
00051 public:
00052 logstream();
00053 ~logstream();
00054 void log_set ( const char* p_pszLogDest);
00055 FILE* log_get();
00056 logstream & operator<< ( const char* cContent);
00057 logstream & operator<< ( long lContent);
00058 void display_version ( char* cLibTag, char* cLibName, char* cLibVersion, char* cLibComment);
00059 void display_version ( char* cLibTag, char* cLibName, int iLibVersion, char* cLibComment);
00060 };
00061
00062 static logstream logout;
00063
00064
00065
00066
00067 #if TRACE_DEBUG==1
00068 static logstream traceout;
00069 #define DEBUG_INIT debug_init();
00070 #define DEBUG_END debug_end();
00071 #define DEBUG_FUNC(func) debug_in(#func) ; debug_startLogLine(" ") ; debug_indent() ; traceout << ">>" << #func << "<<\n"; debug_out(#func);
00072 #define DEBUG_IN(func) debug_in(#func) ; debug_startLogLine(" ") ; debug_indent() ; traceout << ">>" << #func << "\n"; debug_indent(1) ;
00073 #define DEBUG_OUT(func) debug_startLogLine(" ") ; debug_indent(-1) ; debug_indent() ; traceout << "<<" << #func << "\n";debug_out(#func);
00074 #define DEBUG_ECHO debug_startLogLine(" ") ; debug_indent() ; traceout << "-"
00075 #define DEBUG_ERR debug_startLogLine("#") ; debug_indent() ; traceout << "ERROR : "
00076 #define DEBUG_CREATE(obj) debug_create(#obj); debug_startLogLine("+") ; debug_indent() ; traceout << "(+)" << #obj << "\n";
00077 #define DEBUG_DEL(obj) debug_startLogLine("-") ; debug_indent() ; traceout << "(-)" << #obj << "\n";debug_del(#obj);
00078 #define DEBUG_WRITE traceout
00079 #else
00080 #define DEBUG_INIT debug_init();
00081 #define DEBUG_END debug_end();
00082 #define DEBUG_FUNC(func) //cerr << #func <<"\n";
00083 #define DEBUG_IN(func) //cerr << #func <<"\n";
00084 #define DEBUG_OUT(func) //cerr << "/" << #func <<"\n";
00085 #define DEBUG_FUNC_OUT(func) //#func;
00086 #define DEBUG_ECHO if(0) logout
00087 #define DEBUG_ERR if(0) logout
00088 #define DEBUG_WRITE if(0) logout
00089 #define DEBUG_CREATE(obj) //#obj;
00090 #define DEBUG_DEL(obj) //#obj;
00091 #endif
00092
00093
00094 void XDFLENGINE_EXPORT debug_init();
00095 void XDFLENGINE_EXPORT debug_end();
00096 void XDFLENGINE_EXPORT debug_indent(int offset=0);
00097 void XDFLENGINE_EXPORT debug_startLogLine(const char* c);
00098
00099 void XDFLENGINE_EXPORT debug_in(const char* func);
00100 void XDFLENGINE_EXPORT debug_out(const char* func);
00101 void XDFLENGINE_EXPORT debug_create(const char* obj);
00102 void XDFLENGINE_EXPORT debug_del(const char* obj);
00103
00104 #endif
00105