1 #ifndef SG_DEBUGLOG_DEFINES_H
2 #define SG_DEBUGLOG_DEFINES_H
16 std::ofstream log_file;
55 void message(
const char* debug_message);
69 template<
class T>
void value_of(
const std::string& name,
const T& value)
72 log_file << name <<
" = " << value <<
"\n";
80 template<
class T>
void printToLog(
const char* debug_message,
const T& debug_var)
83 log_file << debug_message <<
" " << debug_var <<
"\n";
92 template<
class T,
class K>
void printToLog2(
const char* debug_message,
const T& debug_var1,
const K& debug_var2)
95 log_file << debug_message <<
" " << debug_var1 <<
" " <<debug_var2 <<
"\n";
96 std::cout << debug_message <<
" " << debug_var1 <<
" " <<debug_var2 <<
"\n";
106 template<
class T>
void printToLogArr(
const char* debug_message,
const T debug_var[],
int index)
109 log_file << debug_message;
110 for(
int i=0; i < index; i++)
111 log_file <<
" " << debug_var[i].getPrice() <<
"," << debug_var[i].getQty() <<
";";
117 #define DEBUG_METHOD(DEBUG_OBJECT) { DEBUG_OBJECT->message(__FUNCTION__); }
118 #define DEBUG_MESSAGE(DEBUG_OBJECT,debug_message) { DEBUG_OBJECT->message(debug_message); }
119 #define DEBUG_VALUE_OF(DEBUG_OBJECT,variable) { DEBUG_OBJECT->value_of(#variable, variable); }
120 #define DEBUG_VARSHOW(DEBUG_OBJECT,debug_message,var) { DEBUG_OBJECT->printToLog(debug_message,var); }
121 #define DEBUG_VARSHOW2(DEBUG_OBJECT,debug_message,var1, var2) { DEBUG_OBJECT->printToLog2(debug_message,var1, var2); }
122 #define DEBUG_ARRAYSHOW(DEBUG_OBJECT,debug_message,var,var2) { DEBUG_OBJECT->printToLogArr(debug_message,var,var2); }
123 #define DEBUG_FLUSH(DEBUG_OBJECT) { DEBUG_OBJECT->flushLog(); }
void printToLogArr(const char *debug_message, const T debug_var[], int index)
printToLogArr
Definition: sgDebugLogDefines.h:106
void printToLog2(const char *debug_message, const T &debug_var1, const K &debug_var2)
printToLog2
Definition: sgDebugLogDefines.h:92
void value_of(const std::string &name, const T &value)
value_of
Definition: sgDebugLogDefines.h:69
void timeStamp()
timeStamp
The DebugLog class.
Definition: sgDebugLogDefines.h:9
void openDebugLogFile(int strategyId, int clientId, const char *)
openDebugLogFile
void printToLog(const char *debug_message, const T &debug_var)
printToLog
Definition: sgDebugLogDefines.h:80
void message(const char *debug_message)
message