📄 lvlogger.h
字号:
if (lvlog_LoggingEnabled()) \
{ \
lvlog_EnterCriticalSection(); \
LOG_SPRINTF(g_szLogMessage,LogStr,Var1,Var2); \
lvlog_LogOutput(g_dwLogSenderId, TASK_ID, 0, 1, g_szLogMessage);\
lvlog_LeaveCriticalSection(); \
} \
}
#define LOGENTER3(LogStr,Var1,Var2,Var3) \
{ \
if (lvlog_LoggingEnabled()) \
{ \
lvlog_EnterCriticalSection(); \
LOG_SPRINTF(g_szLogMessage,LogStr,Var1,Var2,Var3); \
lvlog_LogOutput(g_dwLogSenderId, TASK_ID, 0, 1, g_szLogMessage);\
lvlog_LeaveCriticalSection(); \
} \
}
#define LOGENTER4(LogStr,Var1,Var2,Var3,Var4) \
{ \
if (lvlog_LoggingEnabled()) \
{ \
lvlog_EnterCriticalSection(); \
LOG_SPRINTF(g_szLogMessage,LogStr,Var1,Var2,Var3,Var4); \
lvlog_LogOutput(g_dwLogSenderId, TASK_ID, 0, 1, g_szLogMessage);\
lvlog_LeaveCriticalSection(); \
} \
}
#define LOGENTER5(LogStr,Var1,Var2,Var3,Var4,Var5) \
{ \
if (lvlog_LoggingEnabled()) \
{ \
lvlog_EnterCriticalSection(); \
LOG_SPRINTF(g_szLogMessage,LogStr,Var1,Var2,Var3,Var4,Var5); \
lvlog_LogOutput(g_dwLogSenderId, TASK_ID, 0, 1, g_szLogMessage);\
lvlog_LeaveCriticalSection(); \
} \
}
//---------------------------------------------------------------------------
#define LOGENTERAUTO(LogStr) \
{ \
if (lvlog_LoggingEnabled()) \
{ \
lvlog_EnterCriticalSection(); \
LOG_STRCPY(g_szLogMessage,LogStr); \
lvlog_LogOutput(g_dwLogSenderId, TASK_ID, 0, 1, g_szLogMessage);\
lvlog_LeaveCriticalSection(); \
} \
} \
CLogIndent LocalLogIndent;
#define LOGENTERAUTO1(LogStr,Var1) \
{ \
if (lvlog_LoggingEnabled()) \
{ \
lvlog_EnterCriticalSection(); \
LOG_SPRINTF(g_szLogMessage,LogStr,Var1); \
lvlog_LogOutput(g_dwLogSenderId, TASK_ID, 0, 1, g_szLogMessage);\
lvlog_LeaveCriticalSection(); \
} \
} \
CLogIndent LocalLogIndent;
#define LOGENTERAUTO2(LogStr,Var1,Var2) \
{ \
if (lvlog_LoggingEnabled()) \
{ \
lvlog_EnterCriticalSection(); \
LOG_SPRINTF(g_szLogMessage,LogStr,Var1,Var2); \
lvlog_LogOutput(g_dwLogSenderId, TASK_ID, 0, 1, g_szLogMessage);\
lvlog_LeaveCriticalSection(); \
} \
} \
CLogIndent LocalLogIndent;
#define LOGENTERAUTO3(LogStr,Var1,Var2,Var3) \
{ \
if (lvlog_LoggingEnabled()) \
{ \
lvlog_EnterCriticalSection(); \
LOG_SPRINTF(g_szLogMessage,LogStr,Var1,Var2,Var3); \
lvlog_LogOutput(g_dwLogSenderId, TASK_ID, 0, 1, g_szLogMessage);\
lvlog_LeaveCriticalSection(); \
} \
} \
CLogIndent LocalLogIndent;
#define LOGENTERAUTO4(LogStr,Var1,Var2,Var3,Var4) \
{ \
if (lvlog_LoggingEnabled()) \
{ \
lvlog_EnterCriticalSection(); \
LOG_SPRINTF(g_szLogMessage,LogStr,Var1,Var2,Var3,Var4); \
lvlog_LogOutput(g_dwLogSenderId, TASK_ID, 0, 1, g_szLogMessage);\
lvlog_LeaveCriticalSection(); \
} \
} \
CLogIndent LocalLogIndent;
#define LOGENTERAUTO5(LogStr,Var1,Var2,Var3,Var4,Var5) \
{ \
if (lvlog_LoggingEnabled()) \
{ \
lvlog_EnterCriticalSection(); \
LOG_SPRINTF(g_szLogMessage,LogStr,Var1,Var2,Var3,Var4,Var5); \
lvlog_LogOutput(g_dwLogSenderId, TASK_ID, 0, 1, g_szLogMessage);\
lvlog_LeaveCriticalSection(); \
} \
} \
CLogIndent LocalLogIndent;
//---------------------------------------------------------------------------
// the LOGERR macros use the severity 0
#define LOG(LogStr) \
{ \
if (lvlog_LoggingEnabled()) \
{ \
lvlog_EnterCriticalSection(); \
LOG_STRCPY(g_szLogMessage,LogStr); \
lvlog_LogOutput(g_dwLogSenderId, TASK_ID, 0, 0, g_szLogMessage);\
lvlog_LeaveCriticalSection(); \
} \
}
#define LOG1(LogStr,Var1) \
{ \
if (lvlog_LoggingEnabled()) \
{ \
lvlog_EnterCriticalSection(); \
LOG_SPRINTF(g_szLogMessage,LogStr,Var1); \
lvlog_LogOutput(g_dwLogSenderId, TASK_ID, 0, 0, g_szLogMessage);\
lvlog_LeaveCriticalSection(); \
} \
}
#define LOG2(LogStr,Var1,Var2) \
{ \
if (lvlog_LoggingEnabled()) \
{ \
lvlog_EnterCriticalSection(); \
LOG_SPRINTF(g_szLogMessage,LogStr,Var1,Var2); \
lvlog_LogOutput(g_dwLogSenderId, TASK_ID, 0, 0, g_szLogMessage);\
lvlog_LeaveCriticalSection(); \
} \
}
#define LOG3(LogStr,Var1,Var2,Var3) \
{ \
if (lvlog_LoggingEnabled()) \
{ \
lvlog_EnterCriticalSection(); \
LOG_SPRINTF(g_szLogMessage,LogStr,Var1,Var2,Var3); \
lvlog_LogOutput(g_dwLogSenderId, TASK_ID, 0, 0, g_szLogMessage);\
lvlog_LeaveCriticalSection(); \
} \
}
#define LOG4(LogStr,Var1,Var2,Var3,Var4) \
{ \
if (lvlog_LoggingEnabled()) \
{ \
lvlog_EnterCriticalSection(); \
LOG_SPRINTF(g_szLogMessage,LogStr,Var1,Var2,Var3,Var4); \
lvlog_LogOutput(g_dwLogSenderId, TASK_ID, 0, 0, g_szLogMessage);\
lvlog_LeaveCriticalSection(); \
} \
}
#define LOG5(LogStr,Var1,Var2,Var3,Var4,Var5) \
{ \
if (lvlog_LoggingEnabled()) \
{ \
lvlog_EnterCriticalSection(); \
LOG_SPRINTF(g_szLogMessage,LogStr,Var1,Var2,Var3,Var4,Var5); \
lvlog_LogOutput(g_dwLogSenderId, TASK_ID, 0, 0, g_szLogMessage);\
lvlog_LeaveCriticalSection(); \
} \
}
#define LOGWIN32LASTERROR \
{ \
if (lvlog_LoggingEnabled()) \
{ \
int iError = GetLastError(); \
lvlog_EnterCriticalSection(); \
lvlog_LogWin32Error(iError, g_dwLogSenderId, TASK_ID, 0); \
lvlog_LeaveCriticalSection(); \
} \
}
//---------------------------------------------------------------------------
// the LOGERR macros use the severity 1
#define LOGERR(LogStr) \
{ \
if (lvlog_LoggingEnabled()) \
{ \
lvlog_EnterCriticalSection(); \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -