Try to write a macro ZTRACE, that I would use instead of TRACE
This Macro should, depending on TRACELEVEL and TRACEFILE of a paragraph, write the Information into a file. The file should be cloded after each writing.
Background is, that in my Debug-Process I got to write some data, so that 200 lines of a TRACE-Window are not enough.
When parts of code are debugged I want to set TRACELEVEL to zero, so that only important things are written into the file. The neg. TRACELEVELs are reserved for New Lines, with time and line.
#define ZTRACE(LEVEL,STRING) #ifndef TRACELEVEL #define TRACELEVEL 0#endif#ifndef TRACEFILE #define TRACEFILE STANDARDTRACEFILE #define ZTRACEKILLMACROTRACEFILE#endif#if LEVEL < 0 #define TRACEFULL XTraceInt1=-LEVEL#else XTraceInt1=LEVEL #ifdef TRACEFULL #undef TRACEFULL #endif#endif#ifdef TRACELEVEL #if TRACELEVEL>=XTraceInt1 XTraceStreamOnlyInMacro.open(TRACEFILE,ios:
ut | ios::app ); #ifdef TRACEFULL
XTraceStringOnlyInMacro.Format("\n%s\t%s\t%5i\t", __TIME__,__FILE__,__LINE__); #endif XTraceStringOnlyInMacro+=STRING; XTraceStreamOnlyInMacro.close(); #endif#endif#ifdef ZTRACEKILLMACROTRACEFILE #undef ZTRACEKILLMACROTRACEFILE #undef TRACEFILE#endif#ifdef TRACEFULL #undef TRACEFULL
Doesn't compile ...
Where can I find stuff about MACROWriting, the MSDN doesn't really help ...
#endif
Greetings Andreas
This Macro should, depending on TRACELEVEL and TRACEFILE of a paragraph, write the Information into a file. The file should be cloded after each writing.
Background is, that in my Debug-Process I got to write some data, so that 200 lines of a TRACE-Window are not enough.
When parts of code are debugged I want to set TRACELEVEL to zero, so that only important things are written into the file. The neg. TRACELEVELs are reserved for New Lines, with time and line.
#define ZTRACE(LEVEL,STRING) #ifndef TRACELEVEL #define TRACELEVEL 0#endif#ifndef TRACEFILE #define TRACEFILE STANDARDTRACEFILE #define ZTRACEKILLMACROTRACEFILE#endif#if LEVEL < 0 #define TRACEFULL XTraceInt1=-LEVEL#else XTraceInt1=LEVEL #ifdef TRACEFULL #undef TRACEFULL #endif#endif#ifdef TRACELEVEL #if TRACELEVEL>=XTraceInt1 XTraceStreamOnlyInMacro.open(TRACEFILE,ios:
XTraceStringOnlyInMacro.Format("\n%s\t%s\t%5i\t", __TIME__,__FILE__,__LINE__); #endif XTraceStringOnlyInMacro+=STRING; XTraceStreamOnlyInMacro.close(); #endif#endif#ifdef ZTRACEKILLMACROTRACEFILE #undef ZTRACEKILLMACROTRACEFILE #undef TRACEFILE#endif#ifdef TRACEFULL #undef TRACEFULL
Doesn't compile ...
Where can I find stuff about MACROWriting, the MSDN doesn't really help ...
#endif
Greetings Andreas