2007-09-19 16:54:25 +00:00
|
|
|
/* Service debugging (simply logs to a file) */
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdarg.h>
|
2009-01-09 14:38:59 +00:00
|
|
|
#include <windows.h>
|
2007-09-19 16:54:25 +00:00
|
|
|
|
|
|
|
void logmsg(char* string, ...)
|
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
|
|
|
|
FILE* debug_file = fopen("c:\\audiosrv-debug.txt", "a");
|
|
|
|
|
2009-01-09 14:38:59 +00:00
|
|
|
if (debug_file)
|
|
|
|
{
|
|
|
|
va_start(args, string);
|
|
|
|
vfprintf(debug_file, string, args);
|
|
|
|
va_end(args);
|
|
|
|
fclose(debug_file);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
char buf[256];
|
|
|
|
va_start(args, string);
|
|
|
|
vsprintf(buf, string, args);
|
|
|
|
OutputDebugStringA(buf);
|
|
|
|
va_end(args);
|
|
|
|
}
|
2007-09-19 16:54:25 +00:00
|
|
|
}
|