fix: separate any i/o to sequential device from caching layer
[lunaix-os.git] / lunaix-os / includes / lunaix / syslog.h
1 #ifndef __LUNAIX_SYSLOG_H
2 #define __LUNAIX_SYSLOG_H
3
4 #include <stdarg.h>
5
6 #define _LEVEL_INFO "0"
7 #define _LEVEL_WARN "1"
8 #define _LEVEL_ERROR "2"
9 #define _LEVEL_DEBUG "3"
10
11 #define KINFO "\x1b" _LEVEL_INFO
12 #define KWARN "\x1b" _LEVEL_WARN
13 #define KERROR "\x1b" _LEVEL_ERROR
14 #define KDEBUG "\x1b" _LEVEL_DEBUG
15
16 #define LOG_MODULE(module)                                                     \
17     static void kprintf(const char* fmt, ...)                                  \
18     {                                                                          \
19         va_list args;                                                          \
20         va_start(args, fmt);                                                   \
21         __kprintf(module, fmt, args);                                          \
22         va_end(args);                                                          \
23     }
24
25 void
26 __kprintf(const char* component, const char* fmt, va_list args);
27
28 void
29 kprint_hex(const void* buffer, unsigned int size);
30
31 void
32 kprint_panic(const char* fmt, ...);
33
34 #endif /* __LUNAIX_SYSLOG_H */