2021-06-17 21:32:24 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
// Logging
|
2022-04-15 01:12:42 +00:00
|
|
|
#define INFO(format, ...) { fprintf(stderr, "[INFO]: " format "\n", ##__VA_ARGS__); }
|
2022-05-14 02:36:12 +00:00
|
|
|
#define WARN(format, ...) { fprintf(stderr, "[WARN]: " format "\n", ##__VA_ARGS__); }
|
2022-07-08 17:57:48 +00:00
|
|
|
#define DEBUG(format, ...) { const char *debug = getenv("MCPI_DEBUG"); if (debug != NULL) { fprintf(stderr, "[DEBUG]: " format "\n", ##__VA_ARGS__); } }
|
2022-05-14 02:36:12 +00:00
|
|
|
#define ERR(format, ...) { fprintf(stderr, "[ERR]: (%s:%i): " format "\n", __FILE__, __LINE__, ##__VA_ARGS__); exit(EXIT_FAILURE); }
|
2022-04-15 01:12:42 +00:00
|
|
|
#define IMPOSSIBLE() ERR("This Should Never Be Called")
|