1 2 /* 3 * xstress - xk0derz SMTP Stress Tester 4 * 5 * (c) Amit Singh amit@xkoder.com 6 * http://xkoder.com 7 * 8 * This software and related files are licensed under GNU GPL version 2 9 * Please visit the following webpage for more details 10 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 11 */ 12 13 #ifndef __LOGGER_H__ 14 #define __LOGGER_H__ 15 16 #include "common.h" 17 18 using namespace std; 19 20 class Logger 21 { 22 string sLogFile; 23 string sCache; 24 int iThreshold; 25 int threadId; 26 27 public: 28 Logger(string _LogFile=DEFAULT_LOG_FILE,int _cacheThreshold=DEFAULT_CACHE_THRESHOLD); 29 void log(string _msg); 30 void resetThreshold(int _cacheThreshold); 31 void flush(); 32 void setLogFile(string sFileName); 33 void setThreadId(int _id); 34 int getThreadId(); 35 ~Logger(); 36 }; 37 38 extern Logger logger; 39 40 #endif