File: debug.cpp

package info (click to toggle)
sludge 2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,820 kB
  • sloc: cpp: 31,960; sh: 1,037; xml: 874; makefile: 672
file content (27 lines) | stat: -rw-r--r-- 502 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <stdarg.h>

#include "allfiles.h"
#include "debug.h"
#include "language.h"

void debugOut(const char * a, ...) {
	if (! gameSettings.debugMode) return;

	va_list argptr;
	va_start(argptr, a);

#if defined __unix__ && !(defined __APPLE__)
	vfprintf(stderr, a, argptr);
#else
	FILE * fp = fopen ("debuggy.txt", "at");
	if (fp) {
		vfprintf (fp, a, argptr);
		fclose (fp);
	}
#endif
}

void debugHeader()
{
    debugOut( "*** Engine compiled " __DATE__ " at " __TIME__ ".\n");
}