34 lines
766 B
C
34 lines
766 B
C
#include <stdio.h>
|
|
#include <stdarg.h>
|
|
#include <string.h>
|
|
#include <time.h>
|
|
|
|
//#include <string>
|
|
//#include <iostream>
|
|
#include <stdlib.h>
|
|
// #include <windows.h>
|
|
|
|
/*******************************************************
|
|
int DebugPrint(const char * fmt, ...)
|
|
功能描述:
|
|
提供类似于printf的调试打印语句
|
|
********************************************************/
|
|
int DebugPrint(const char * fmt, ...)
|
|
{
|
|
char sDebug[10240];
|
|
char tbuffer[9];
|
|
va_list vaParams;
|
|
|
|
time_t now;
|
|
time(&now);
|
|
strftime(sDebug, sizeof(sDebug), "[%Y-%m-%d %H:%M:%S]",localtime(&now));
|
|
|
|
va_start(vaParams,fmt);
|
|
vsprintf(sDebug+strlen(sDebug),fmt,vaParams);
|
|
|
|
// OutputDebugString( sDebug );
|
|
printf( "%s\n", sDebug );
|
|
|
|
return 1;
|
|
}
|