12 lines
579 B
C
Raw Normal View History

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