ppd/include/logger.h

18 lines
385 B
C
Raw Normal View History

2023-01-17 20:22:43 +00:00
#pragma once
#include <stdio.h>
#define W(fmt, ...) do { \
fprintf(stderr, "[WARN] %s: " fmt, __func__, ##__VA_ARGS__); \
} while(0)
#define E(fmt, ...) do { \
fprintf(stderr, "[ERROR] %s: " fmt, __func__, ##__VA_ARGS__); \
exit(1); \
} while(0)
#define V(fmt, ...) do { \
if (options.verbose) { \
fprintf(stdout, "[INFO] %s: " fmt, __func__, ##__VA_ARGS__); \
} \
} while(0)