summaryrefslogtreecommitdiff
path: root/src/log.h
blob: 12135afc41262ddab826c2ae62a5918d92201bc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma once

#include <stdio.h>

#define dbg(format, ...) \
	dbgl(format "\n", ##  __VA_ARGS__)

#define dbgl(format, ...) \
	printf(format, ## __VA_ARGS__); \
	fflush(stderr)

#define err(format, ...) \
	printf(format "\n", ## __VA_ARGS__); \
	fflush(stderr)

#define fatal(format, ...) do{\
		printf(format "\n", ## __VA_ARGS__); \
		fflush(stderr); \
		abort(); \
	} while(0)