直接上代码:
#include "windows.h"
void OutputDebugPrintf(const char * strOutputString,...)
{
char strBuffer[4096]={0};
va_list vlArgs;
va_start(vlArgs,strOutputString);
_vsnprintf(strBuffer,sizeof(strBuffer)-1,strOutputString,vlArgs);
va_end(vlArgs);
OutputDebugStringA(strBuffer); //windows API
}
例子:
OutputDebugPrintf("trace_level:%d, len: %d \r\n",trace_level,len);
阅读(2185) | 评论(0) | 转发(0) |