Initial commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user