-
Notifications
You must be signed in to change notification settings - Fork 0
/
kernel_debug_logger.h
60 lines (51 loc) · 1.11 KB
/
kernel_debug_logger.h
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef KERNEL_DEBUG_LOGGER_H_
#define KERNEL_DEBUG_LOGGER_H_
#if KERNEL_DEBUG_PRINT
#define KERNEL_LOG_DEBUG(...) \
{ \
do { \
printf("[KERNEL_DEBUG] --> %s:%d\t| ", __FILE__, __LINE__); \
printf(__VA_ARGS__); \
printf("\n");} \
while (0); \
}
#else
#define KERNEL_LOG_DEBUG(...)
#endif
#if KERNEL_INFO_PRINT
#define KERNEL_LOG_INFO(...) \
{ \
do { \
printf("[KERNEL_INFO] --> %s:%d\t| ", __FILE__, __LINE__); \
printf(__VA_ARGS__); \
printf("\n");} \
while (0); \
}
#else
#define KERNEL_LOG_INFO(...)
#endif
#if KERNEL_WARN_PRINT
#define KERNEL_LOG_WARNING(...) \
{ \
do { \
printf("[KERNEL_WARNING] --> %s:%d\t| ", __FILE__, __LINE__); \
printf(__VA_ARGS__); \
printf("\n");} \
while (0); \
}
#else
#define KERNEL_LOG_WARNING(...)
#endif
#if KERNEL_ERROR_PRINT
#define KERNEL_LOG_ERROR(...) \
{ \
do { \
printf("[KERNEL_ERROR] --> %s:%d\t| ", __FILE__, __LINE__); \
printf(__VA_ARGS__); \
printf("!!!\n");} \
while (0); \
}
#else
#define KERNEL_LOG_ERROR(...)
#endif
#endif // KERNEL_DEBUG_LOGGER_H_