You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dexed/src/trace.c

23 lines
472 B

8 years ago
#ifdef DEBUG
#include <stdio.h>
#include <stdarg.h>
void _trace(const char *source, const char *fmt, ...) {
char output[1024];
8 years ago
va_list argptr;
va_start(argptr, fmt);
vsnprintf(output, 1023, fmt, argptr);
8 years ago
va_end(argptr);
#ifdef FILETRACE
FILE *fp;
fp=fopen("/tmp/dexed.log", "a");
fputs(source, fp);
fputs(": ", fp);
fputs(output, fp);
fputs("\n", fp);
fclose(fp);
#else
8 years ago
printf("%s: %s\n",source,output);
#endif
8 years ago
}
#endif