Linux:
void CServerlog::WriteFormatDebugLog(char* lpFormat, ...)
{
const DWORD BufSize = 1024;
char szBuffer[BufSize];
va_list args; //格式化消息
va_start(args, lpFormat);
vsprintf(szBuffer, lpFormat, args); //vsprintf_s BufSize - strlen(szMsg),
va_end(args);
LOG4CXX_DEBUG(infologger,szBuffer);
}
VC下:
void CServerlog::WriteFormatInfoLog(LPCSTR lpFormat, ...)
{
const DWORD BufSize = 1024;
char szMsg[BufSize];
va_list args; //格式化消息
va_start(args, lpFormat);
wvsprintfA(szMsg, lpFormat, args); //vsprintf_s BufSize - strlen(szMsg),
va_end(args);
//输出信息
LOG4CXX_INFO(infologger,szMsg);
}