00001 #ifndef AFL_TRACE_H
00002 #define AFL_TRACE_H
00003
00004 #include <iostream>
00005
00006 extern std::ostream* logfile;
00007
00008 #include "afltypes.h"
00009
00010 #ifndef DEBUG
00011 #define TRACE(A)
00012 #define SHOWPARAMS(A)
00013 #else
00014 #define TRACE(A) AFL_LOG_PRIVATE(A,"gnrl")
00015 #define SHOWPARAMS(A) showParameters(A)
00016 #endif
00017
00018 #ifndef XMLDEBUG
00019 #define XMLTRACE(A)
00020 #else
00021 #define XMLTRACE(A) AFL_LOG_PRIVATE(A,"xml ")
00022 #endif
00023
00024 #ifndef BOUNDARYDEBUG
00025 #define BOUNDARYTRACE(A)
00026 #else
00027 #define BOUNDARYTRACE(A) AFL_LOG_PRIVATE(A,"bnds")
00028 #endif
00029
00030 #ifndef FUNCTIONSDEBUG
00031 #define FUNCTIONSTRACE(A)
00032 #else
00033 #define FUNCTIONSTRACE(A) AFL_LOG_PRIVATE(A,"func")
00034 #endif
00035
00036 #define AFL_LOG_PRIVATE(A,B) (*logfile) << __FILE__ << " @ " << __LINE__ <<\
00037 ' ' << B << ": " << A << std::endl;
00038
00039 void aflSetLogFile(std::ostream& out);
00040 void showParameters(const afl::Parameters& params);
00041
00042 #endif