This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef LOGGING_H | |
| #define LOGGING_H | |
| #define LOGPREFIX "[%s] [%s:%d:%s()]" | |
| #define LOG(LVL, FMT, ...) fprintf(stderr, LOGPREFIX" "FMT"\n", LVL, __FILE__, __LINE__, __func__, ##__VA_ARGS__) | |
| #ifdef NDEBUG | |
| #define DEBUG(FMT, ...) LOG("DEBUG", FMT, ##__VA_ARGS__) | |
| #else | |
| #define DEBUG(FMT, ...) ((void)0) |