I use the following method to disable the function time:
char szMessageBuffer[2048] = {0};\
va_list ArgList;\
va_start(ArgList, message);\
vsprintf_s(szMessageBuffer, 2048, message, ArgList);\
va_end(ArgList); \
string strMessage(szMessageBuffer);\
CQLogTimer t(strMessage);
// CQLogTimer is the destructor itself, which will use its own lifetime and print szMessageBuffer. However, when I use a macro, this is:
void fun
{
TIME_COST("hello->%s", filePath);
XXXXXX
}
The created message always welcomes → (null)
Can anyone help? Many thanks!
source
share