Karg  v0.2.0
The kernel of CargOS
log.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <stddef.h>
4 
5 typedef enum {
13 
14 void klogf(log_severity_t severity, const char *fmt, ...);
15 
16 #define log_debug(fmt, ...) \
17  klogf(LOG_SEVERITY_DEBUG, "%s: " fmt "\n", _MODULE_NAME, ##__VA_ARGS__)
18 #define log_info(fmt, ...) \
19  klogf(LOG_SEVERITY_INFO, "%s: " fmt "\n", _MODULE_NAME, ##__VA_ARGS__)
20 #define log_warning(fmt, ...) \
21  klogf(LOG_SEVERITY_WARNING, "%s: " fmt "\n", _MODULE_NAME, ##__VA_ARGS__)
22 #define log_error(fmt, ...) \
23  klogf(LOG_SEVERITY_ERROR, "%s: " fmt "\n", _MODULE_NAME, ##__VA_ARGS__)
24 #define log_critical(fmt, ...) \
25  klogf(LOG_SEVERITY_CRITICAL, "%s: " fmt "\n", _MODULE_NAME, ##__VA_ARGS__)
26 #define log_panic(fmt, ...) \
27  { \
28  klogf(LOG_SEVERITY_PANIC, "%s: " fmt "\n", _MODULE_NAME, \
29  ##__VA_ARGS__); \
30  unreachable(); \
31  }
void klogf(log_severity_t severity, const char *fmt,...)
Definition: log.c:81
log_severity_t
Definition: log.h:5
@ LOG_SEVERITY_INFO
Definition: log.h:7
@ LOG_SEVERITY_CRITICAL
Definition: log.h:10
@ LOG_SEVERITY_WARNING
Definition: log.h:8
@ LOG_SEVERITY_PANIC
Definition: log.h:11
@ LOG_SEVERITY_DEBUG
Definition: log.h:6
@ LOG_SEVERITY_ERROR
Definition: log.h:9