#pragma once #include #include #include #ifdef _WIN32 #include #else // Linux #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) #define __FUNCTION__ __func__ #endif #ifdef _WIN32 #ifdef _UNICODE #define DebugPrint DebugPrintW #else #define DebugPrint DebugPrintA #endif #else // Linux // Linux ÏÂĬÈÏʹÓà UTF-8 Õ­×Ö·û #define DebugPrint DebugPrintA #endif void SetPrintLog(bool Enable); //extern BOOL dum_log_file; #define MAX_PATH 260 #define ONE_LOG_MAX_SIZE (524288) #ifdef _DEBUG #define DebugPrintA(format,...) __DebugPrintA(__FILE__,__LINE__,__FUNCTION__,format,__VA_ARGS__) #define DebugPrintW(format,...) __DebugPrintW(__FILE__,__LINE__,__FUNCTION__,format,__VA_ARGS__) #else #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 "UNKNOWN" #endif 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 __ReleasePrintW( char* file, int line, char* function, wchar_t* format, ... );