aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/log.h
blob: f0500485914d8870544db57e8022f773f75a5b90 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#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__);                                                      \
	}

#endif