blob: 78a70476a3a7eb7e8011649a347c888013686c5d [file] [log] [blame]
swissChili0b35bf22021-02-18 12:49:40 -08001#pragma once
2
3#include "kint.h"
4
swissChili9bd74de2021-06-15 20:30:48 -07005#define RESET "\033[0m"
6#define INFO "[\033[96m INFO " RESET "] "
7#define OKAY "[\033[92m OK " RESET "] "
swissChilib7ef65d2021-07-17 12:51:52 -07008#define WARN "[\033[93m WARN " RESET "] "
swissChili9bd74de2021-06-15 20:30:48 -07009#define ERROR "[\033[91m ERROR " RESET "] "
10#define DEBUG "[\033[93m DEBUG " RESET "] "
swissChilib58ab672022-01-17 21:18:01 -080011#define BRKPT "[\033[96m BRKPT " RESET "] "
12#define REACHED_HERE FORMAT_AT(__FILE__, __LINE__)
13#define FORMAT_AT(file, line) "@" file ":%d\n", line
swissChili9bd74de2021-06-15 20:30:48 -070014
swissChili0b35bf22021-02-18 12:49:40 -080015void kprintf(const char *format, ...);
swissChili825d46b2021-02-21 10:14:16 -080016void kassert_int(bool condition, const char *message, const char *file,
17 const int line);
swissChili0b35bf22021-02-18 12:49:40 -080018
19#define kassert(cond, msg) kassert_int((cond), (msg), __FILE__, __LINE__)
swissChili9bd74de2021-06-15 20:30:48 -070020#define kpanic(msg) \
21 kassert(false, msg); \
swissChili825d46b2021-02-21 10:14:16 -080022 __builtin_unreachable()