aboutsummaryrefslogtreecommitdiff
path: root/src/logger.h
blob: 4350cf1a9b036b7602c31804624a6daf69d472ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef LOGGER_H
#define LOGGER_H

#include <stdio.h>

enum log_levels {
	LOG_ERROR,
	LOG_INFO,
	LOG_DEBUG,
	LOG_INSANEDEBUG,
};

#define LOGFP stderr
#define LOGLEVEL

#define LOG(LEVEL, args...) do { \
	if (LEVEL <= LOG_LEVEL) { \
		fprintf(LOGFP, args); \
	} \
} while (0)

#endif