#pragma once #include #ifdef _UNICODE #define DebugPrint DebugPrintW #else #define DebugPrint DebugPrintA #endif #include "DIOS.Dev.IODevice.hpp" using namespace DIOS::Dev; typedef enum _Log_Level { LOG_LEVEL_INIT, LOG_LEVEL_TRACE, LOG_LEVEL_DEBUG, LOG_LEVEL_INFO, LOG_LEVEL_WARNING, LOG_LEVEL_ERROR, LOG_LEVEL_FATAL, LOG_LEVEL_MAX }LOG_LEVEL; #define PRINTA_TRACE(format,...) __ReleasePrintA(LOG_LEVEL_TRACE,__LINE__,__FUNCTION__,format,__VA_ARGS__) #define PRINTA_DEBUG(format,...) __ReleasePrintA(LOG_LEVEL_DEBUG,__LINE__,__FUNCTION__,format,__VA_ARGS__) #define PRINTA_INFO(format,...) __ReleasePrintA(LOG_LEVEL_INFO,__LINE__,__FUNCTION__,format,__VA_ARGS__) #define PRINTA_WARN(format,...) __ReleasePrintA(LOG_LEVEL_WARNING,__LINE__,__FUNCTION__,format,__VA_ARGS__) #define PRINTA_ERROR(format,...) __ReleasePrintA(LOG_LEVEL_ERROR,__LINE__,__FUNCTION__,format,__VA_ARGS__) #define PRINTA_FATAL(format,...) __ReleasePrintA(LOG_LEVEL_FATAL,__LINE__,__FUNCTION__,format,__VA_ARGS__) void WINAPI CreateLogger(std::shared_ptr EventCenter); void WINAPI CreateLogger(std::string strLogName); void WINAPI ReleaseLogger(); void __ReleasePrintA( LOG_LEVEL level, /*char* file,*/ int line, char* function, char* format, ... ); class TempLogger { public: TempLogger(std::shared_ptr EventCenter); ~TempLogger(); std::shared_ptr g_EventCenter; HANDLE dump_Mutex; char* g_log_abuff = NULL; std::string GetTime(); };