swissChili | 0b35bf2 | 2021-02-18 12:49:40 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "kint.h" |
| 4 | |
swissChili | 9bd74de | 2021-06-15 20:30:48 -0700 | [diff] [blame] | 5 | #define RESET "\033[0m" |
| 6 | #define INFO "[\033[96m INFO " RESET "] " |
| 7 | #define OKAY "[\033[92m OK " RESET "] " |
swissChili | b7ef65d | 2021-07-17 12:51:52 -0700 | [diff] [blame] | 8 | #define WARN "[\033[93m WARN " RESET "] " |
swissChili | 9bd74de | 2021-06-15 20:30:48 -0700 | [diff] [blame] | 9 | #define ERROR "[\033[91m ERROR " RESET "] " |
| 10 | #define DEBUG "[\033[93m DEBUG " RESET "] " |
| 11 | |
swissChili | 0b35bf2 | 2021-02-18 12:49:40 -0800 | [diff] [blame] | 12 | void kprintf(const char *format, ...); |
swissChili | 825d46b | 2021-02-21 10:14:16 -0800 | [diff] [blame] | 13 | void kassert_int(bool condition, const char *message, const char *file, |
| 14 | const int line); |
swissChili | 0b35bf2 | 2021-02-18 12:49:40 -0800 | [diff] [blame] | 15 | |
| 16 | #define kassert(cond, msg) kassert_int((cond), (msg), __FILE__, __LINE__) |
swissChili | 9bd74de | 2021-06-15 20:30:48 -0700 | [diff] [blame] | 17 | #define kpanic(msg) \ |
| 18 | kassert(false, msg); \ |
swissChili | 825d46b | 2021-02-21 10:14:16 -0800 | [diff] [blame] | 19 | __builtin_unreachable() |