diff options
Diffstat (limited to 'kernel/log.h')
| -rw-r--r-- | kernel/log.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/kernel/log.h b/kernel/log.h index 62fe6ef..e46a7b2 100644 --- a/kernel/log.h +++ b/kernel/log.h @@ -1,6 +1,8 @@ #ifndef FOOLOS_LOG_H #define FOOLOS_LOG_H +#include "kernel.h" + #include <stdbool.h> #define FOOLOS_LOG_ERROR 5 @@ -11,4 +13,17 @@ void log(bool color,char *module_name, int prio, char *format_string, ...); +// __FUNCTION__ ? +#ifndef FOOLOS_LOG_OFF +#define kpanic(...) {log(FOOLOS_LOG_COLOR,__FILE__,0," \033[41;37m [KERNEL PANIC] \033[37;40m " __VA_ARGS__ ); while(1);} +#define klog(...) log(FOOLOS_LOG_COLOR,__FILE__ ":" S2(__LINE__), 10, __VA_ARGS__) +#define fixme(...) log(FOOLOS_LOG_COLOR,__FILE__ ":" S2(__LINE__) "[FIXME/TODO]:" , 10, __VA_ARGS__) +#endif + +#ifdef FOOLOS_LOG_OFF +#define kpanic(...) {while(1);} +#define klog(...) {} +#define fixme(...) {} +#endif + #endif |
