summaryrefslogtreecommitdiff
path: root/src/debug.c
blob: 34918cdb69c2463f78d22890180cdf8835ceeea6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
* License: BSD-style license
* Copyright: Radek Podgorny <radek@podgorny.cz>,
*/
#include <stdio.h>

#include "debug.h"


FILE* dbgfile = NULL;

int debug_init() {
#ifdef DEBUG
	char *dbgpath = "./unionfs_debug.log";
	printf("Debug mode, log will be written to %s\n", dbgpath);

	dbgfile = fopen(dbgpath, "w");
	if (!dbgfile) {
		printf("Failed to open %s for writing, exitting\n", dbgpath);
		return 2;
	}
#endif
	return 0;
}