blob: ba927882cc4c2015c9cae7a879af87ab587ae95c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#ifndef FOOLOS_LOG_H
#define FOOLOS_LOG_H
#include "kernel.h"
#include <stdbool.h>
#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
|