summaryrefslogtreecommitdiff
path: root/src/log.h
blob: 77eab3539fa2e3d3af788ecd056d9a42fd661e77 (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
#pragma once

#include <stdio.h>
#include <stdlib.h>

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

#define dbgl(format, ...) do{\
		printf(format, ## __VA_ARGS__); \
		fflush(stderr); \
	} while(0)

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

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