aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/src/log.h
blob: 03e885682cbc14131f978308f5eed881390c3ad0 (plain) (tree)


















                                                                                                    

                                          
      
#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