aboutsummaryrefslogtreecommitdiff
path: root/log.c
blob: 34f0647ca841adf96bb502daf63747d3942fbbc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdlib.h>
#include <stdio.h>

#define LOGFILE	"7w.log"     // all Log(); messages will be appended to this file

int firstOpen = 1;

void Log(char *message) {
	FILE *file;

	if(firstOpen)
		file = fopen(LOGFILE, "w");
	else
		file = fopen(LOGFILE, "a+");
	firstOpen = 0;
	fprintf(file, "%s\n", message); /*writes*/
	fclose(file); /*done!*/
}
bgstack15