25 #define LOG_MSG_NO_ERROR_VERBOSE 5 26 #define LOG_MSG_ERROR_VERBOSE 1 27 #define LOG_MSG_ERROR_SEVERE 0 30 #define LOG(format, ...) { char buffer[1024]; snprintf(buffer, 1024, format, ## __VA_ARGS__); std::string str = buffer; globalLog.writeLine(str); printf(format, ## __VA_ARGS__); } 32 #define LOG_MSG(index, format, ...) { if (index <= globalLog.debugLevel) { char buffer[1024]; snprintf(buffer, 1024, format, ## __VA_ARGS__); std::string str = buffer; globalLog.writeLine(str); printf(format, ## __VA_ARGS__); } } 34 #define LOG_VERBOSE(format, ...) { if (LOG_MSG_NO_ERROR_VERBOSE <= globalLog.debugLevel) { char buffer[1024]; snprintf(buffer, 1024, format, ## __VA_ARGS__); std::string str = buffer; globalLog.writeLine(str); printf(format, ## __VA_ARGS__); } } 36 #define LOG_ERROR(format, ...) { if (LOG_MSG_ERROR_VERBOSE <= globalLog.debugLevel) { char buffer[1024]; snprintf(buffer, 1024, format, ## __VA_ARGS__); std::string str = buffer; globalLog.writeLine(str); printf(format, ## __VA_ARGS__); } } 38 #define LOG_ERROR_SEVERE(format, ...) { if (LOG_MSG_ERROR_SEVERE <= globalLog.debugLevel) { char buffer[1024]; snprintf(buffer, 1024, format, ## __VA_ARGS__); std::string str = buffer; globalLog.writeLine(str); printf(format, ## __VA_ARGS__); } } 41 #define LOG_MSG_LEVEL(index) (index <= globalLog.debugLevel) 42 #define LOG_INPUT_LEVEL(index) (index <= globalLog.inputLevel) 56 void writeLine(std::string line,
bool append =
true);
static std::string getTimeAsStr()
void setDebugLevel(int debugLevel)
void setInputLevel(int inputLevel)
void setFilename(std::string filename)
void writeLine(std::string line, bool append=true)
static std::string generateLogname(std::string path)