Is this what you are looking for?

Code:
#include <iostream>
#include <Windows.h>

inline void Trace( const char* format , ... )
{
#ifndef NDEBUG
	char buffer[ 0x400 ];
	va_list  fmt_list;

	va_start( fmt_list, format );
 	vsprintf_s( buffer, 0x400, format, fmt_list );
	va_end( fmt_list );
 	strcat_s( buffer, 0x400 ,"\n" );

	// ::OutputDebugString( buffer );
	std::cout << buffer;
#endif // NDEBUG
}


int main()
{
	Trace( "Error: %i , %i" , 34 , 35 );
}