aboutsummaryrefslogtreecommitdiff
path: root/log.h
blob: 61bf8a980571de7ffcefac0787790fd0cc9c6967 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// SPDX-License-Identifier: ISC
// SPDX-FileCopyrightText: 2024 Matthew Wozniak <me@woz.blue>

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

#define die(fmt, ...) {\
	fprintf(stderr, "err: %s: " fmt "\n", __func__ __VA_OPT__(,) __VA_ARGS__); \
	exit(1); \
}

#define warn(fmt, ...) \
	fprintf(stderr, "warn: %s: " fmt "\n", __func__ __VA_OPT__(,) __VA_ARGS__)

#define info(fmt, ...) \
	fprintf(stderr, "info: %s: " fmt "\n", __func__ __VA_OPT__(,) __VA_ARGS__)

// vi: sw=4 ts=4 noet tw=80 cc=80