void Reporter::record(unsigned int outType, RPT_MSGTYPE messageType, const char* format, ...)
{
va_list args;
// retrieve the variable arguments
va_start( args, format );
int len;
#ifdef _MSC_VER
int tem = _vscprintf( format, args );
len = _vscprintf( format, args ) // _vscprintf doesn't count
+ 1; // terminating '/0'
#else
char tmp[16];
len = vsnprintf(tmp, sizeof(tmp)-1, format, args) + 4;
#endif
char buffer[1024] = "";
vsprintf( buffer, format, args ); // C4996
va_end(args);
//must to construct a string type with the char* at here,
//else it will call the record(,,const char* format, ...)
//and will cause an calling circle
record(outType, messageType, string(buffer));
//free(buffer);
}