#pragma once #include #include using namespace std; #ifdef _UNICODE #define DebugPrint DebugPrintW #define DebugPrintSimple #else #define DebugPrint DebugPrintA #define DebugPrintSimple DebugPrintSimpleA #endif std::string myformat(const char *fmt, ...) ; void WINAPI SetDebugPrintFlag(bool Enable); BOOL WINAPI GetDebugPrintFlag(); void WINAPI SetLogFilePath(const char *pPath); //extern BOOL dum_log_file; #define ONE_LOG_MAX_SIZE (524288) void __DebugPrintSimpleA( char* format, ... ); void __DebugPrintA( char* file, int line, char* function, char* format, ... ); void __DebugPrintW( char* file, int line, char* function, wchar_t* format, ... ); void __ReleasePrintA( char* file, int line, char* function, char* format, ... ); void __ReleasePrintSimpleA( char* format, ... ); void __ReleasePrintW( char* file, int line, char* function, wchar_t* format, ... ); bool InitDumpFile(); #ifdef _DEBUG #define DebugPrintSimpleA(format,...) __DebugPrintSimpleA(format,__VA_ARGS__) #define DebugPrintA(format,...) __DebugPrintA(__FILE__,__LINE__,__FUNCTION__,format,__VA_ARGS__) #define DebugPrintW(format,...) __DebugPrintW(__FILE__,__LINE__,__FUNCTION__,format,__VA_ARGS__) #else #define DebugPrintSimpleA(format,...) __ReleasePrintSimpleA(format,__VA_ARGS__) #define DebugPrintA(format,...) __ReleasePrintA(__FILE__,__LINE__,__FUNCTION__,format,__VA_ARGS__) #define DebugPrintW(format,...) __ReleasePrintW(__FILE__,__LINE__,__FUNCTION__,format,__VA_ARGS__) #endif //define project name before include debug.h #if defined _LISMSOCKET #define PROJECT_NAME "LISM_SOCKET" #elif defined _LISMSERVER #define PROJECT_NAME "LISM_SERVER" #elif defined _LISMCLIENT #define PROJECT_NAME "LISM_CLIENT" #elif defined _LISMCONSOLE #define PROJECT_NAME "LISM_CONSOLE" #elif defined _LISMDRIVERAPI #define PROJECT_NAME "LISM_DRIVERAPI" #elif defined _LISMDADTABASE #define PROJECT_NAME "LISM_DADTABASE" #elif 1 #define PROJECT_NAME "E-COM" #endif class debug_funcs { public: debug_funcs(void); virtual ~debug_funcs(void); }; //new line here------------------------