Skip to content

Instantly share code, notes, and snippets.

@saga
Created March 6, 2013 00:56
Show Gist options
  • Save saga/5095841 to your computer and use it in GitHub Desktop.
Save saga/5095841 to your computer and use it in GitHub Desktop.
log with C++
//inline void _cdecl WriteLog(LPCTSTR lpszFormat, ...)
void WriteLog(LPCTSTR lpszFormat, ...) {
va_list args; va_start(args, lpszFormat);
int nBuf; TCHAR szBuffer[512];
nBuf = _vstprintf(szBuffer, lpszFormat, args); _ASSERTE(nBuf < sizeof(szBuffer));
OutputDebugString(szBuffer);
va_end(args);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment