123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- #pragma once
- #include <string>
- #include <windows.h>
- 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------------------------
|