summaryrefslogtreecommitdiff
path: root/kernel/log.h
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-09-12 15:23:38 +0200
committerMiguel <m.i@gmx.at>2018-09-12 15:23:38 +0200
commitc72944b5646863ffaaaff94dc03b939a08566203 (patch)
tree3ce3d74fc27b297cd6958d0d8ba588ccbbe16bfb /kernel/log.h
parent800b1a878ec34a8ff30ed093e20561182fa6ae36 (diff)
struggling with vmem
Diffstat (limited to 'kernel/log.h')
-rw-r--r--kernel/log.h15
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