aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/log.h
blob: 03e885682cbc14131f978308f5eed881390c3ad0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef __LOG_H__
#define __LOG_H__

#include <netdb.h>
#include <stdio.h>
#include <string.h>

#define print_errno(s)                                                                             \
	{                                                                                          \
		fprintf(stderr, "%s(%d): ", basename(__FILE__), __LINE__);                         \
		perror(s);                                                                         \
	}

#define print_error(...)                                                                           \
	{                                                                                          \
		fprintf(stderr, "%s(%d): ", basename(__FILE__), __LINE__);                         \
		fprintf(stderr, __VA_ARGS__);                                                      \
	}

#define print_log(...) printf(__VA_ARGS__)

#endif