1
0
mirror of https://github.com/DxWnd/DxWnd.reloaded synced 2024-12-30 09:25:35 +01:00
DxWnd.reloaded/host/OutTrace.cpp
gho tik d85bf10866 v2_03_80_src
Former-commit-id: faa04e235cf8faae10f9e220ca51eef95c7115f0
2017-03-06 11:46:49 -05:00

23 lines
479 B
C++

#include "stdafx.h"
#define DXWMAXLOGSIZE 4096
void OutTrace(const char *format, ...)
{
va_list al;
static char path[MAX_PATH];
static FILE *fp=NULL; // GHO: thread safe???
char sBuf[DXWMAXLOGSIZE+1];
extern BOOL gbDebug;
if (!gbDebug) return;
if (fp == NULL) fp = fopen(".\\dxwnd.log", "w+");
va_start(al, format);
vsprintf_s(sBuf, DXWMAXLOGSIZE, format, al);
sBuf[DXWMAXLOGSIZE]=0; // just in case of log truncation
va_end(al);
fputs(sBuf, fp);
fflush(fp);
}