12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #pragma once
- #include <windows.h>
- #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 <DIOS::Dev::IOEventCenter> 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 <DIOS::Dev::IOEventCenter> EventCenter);
- ~TempLogger();
- std::shared_ptr <DIOS::Dev::IOEventCenter> g_EventCenter;
- HANDLE dump_Mutex;
- char* g_log_abuff = NULL;
- std::string GetTime();
- };
|