aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/log.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/log.h')
-rw-r--r--src/log.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/log.h b/src/log.h
new file mode 100644
index 0000000..f050048
--- /dev/null
+++ b/src/log.h
@@ -0,0 +1,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