#ifndef FOOLOS_LOG_H #define FOOLOS_LOG_H #include "kernel.h" #include #define FOOLOS_LOG_ERROR 5 #define FOOLOS_LOG_WARNING 4 #define FOOLOS_LOG_INFO 3 #define FOOLOS_LOG_DEBUG 2 #define FOOLOS_LOG_FINE 1 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__) , 10, " \033[46;37m [FIXME] \033[37;40m "__VA_ARGS__) #endif #ifdef FOOLOS_LOG_OFF #define kpanic(...) {while(1);} #define klog(...) {} #define fixme(...) {} #endif #endif