void out_msg( const char *msg, ... ) { va_list args; va_start( args, msg ); vprintf_s( msg, args ); va_end( args ); }
// Exit with a given error message. static void errorExit(const char *format,...) { va_list arg; va_start(arg,format); vprintf_s(format,arg); va_end(arg); exit(1); }
static int CPU_Printf (char *p_str, ...) { va_list param; int ret; va_start(param, p_str); ret = vprintf_s(p_str, param); va_end(param); return (ret); }
void say(const char *fmt, ...) { va_list ap; escape_curses(); va_start(ap, fmt); #ifdef HAVE_BCI vprintf_s(fmt, ap); #else vprintf(fmt, ap); #endif va_end(ap); fflush(stdout); }
void Logger::Log(char* szText, ...) { va_list args; va_start(args, szText); time_t rawtime; tm timeinfo; time(&rawtime); localtime_s(&timeinfo, &rawtime); CONSOLECOLOR(YELLOW); printf(" %02d:%02d:%02d %02d-%02d ", timeinfo.tm_hour, timeinfo.tm_min, timeinfo.tm_min, timeinfo.tm_mday, ++timeinfo.tm_mon); CONSOLECOLOR(LIGHTCYAN); printf("> "); CONSOLECOLOR(LIGHTGRAY); vprintf_s(szText, args); va_end(args); }
void echo(const char * format, ...) { va_list ap; va_start(ap, format); vprintf_s(format, ap); std::string s = CommonFunctions::FormatOutputString("logs", "CrashLog", false); FILE * m_file; fopen_s(&m_file, s.c_str(), "a"); if(!m_file) { va_end(ap); return; } vfprintf_s(m_file, format, ap); fclose(m_file); va_end(ap); }
void write(level l, const char * format, ...) { if((l & __tracelevel) != l) return; va_list args; va_start(args, format); color(l); #ifdef WIN32 vprintf_s(format,args); printf_s("\n"); #else vprintf(format,args); printf("\n"); #endif }
int Logger::log( int level, char *msg, ... ) { uuidBufInd = 0; if ( this->logMode == LOG_MODE_OFF ) return 0; if ( this->logLevel < level ) return 0; va_start( valist, msg ); char formatBuf[64]; if ( this->timeStamp ) { time_t t_t; _timeb tb; struct tm stm; apb->apbtime( &t_t ); apb->apb_ftime_s( &tb ); localtime_s( &stm, &t_t ); strftime( formatBuf, 64, "%H:%M:%S", &stm ); sprintf_s( timeBuf, 64, "[%s.%3d] ", formatBuf, tb.millitm ); } if ( this->logMode & LOG_MODE_COUT ) { if ( this->timeStamp ) printf( timeBuf ); vprintf_s( msg, valist ); printf( "\n" ); } if ( this->logMode & LOG_MODE_FILE ) { if ( this->timeStamp ) fprintf( this->file, timeBuf ); vfprintf_s( this->file, msg, valist ); fprintf( this->file, "\n" ); this->flush(); } return 0; }
int __cdecl hal_vprintf( const char* format, va_list arg ) { return vprintf_s ( format, arg ); }
void Printf( char const *format, ... ) { va_list args; va_start( args, format ); vprintf_s( format, args ); va_end( args ); }