#ifndef KPRINTF_H_ #define KPRINTF_H_ #include #include "term/term.h" #include "spinlock/spinlock.h" #define kprintf(fmt, ...) \ do { \ printf_(fmt, ##__VA_ARGS__); \ } while(0) #define ksprintf sprintf_ #define kvsprintf vsprintf_ #define ksnprintf snprintf_ #define kvsnprintf vsnprintf_ #define kvprintf vprintf_ #ifdef KPRINTF_COLORS # include "ansi_colors.h" # define LOG(component, fmt, ...) kprintf(CRESET "[" CYN component CRESET "]: " fmt, ##__VA_ARGS__) #else # define LOG(component, fmt, ...) kprintf("["component"]: "fmt, ##__VA_ARGS__) #endif #ifdef KPRINTF_COLORS # include "ansi_colors.h" # define ERR(component, fmt, ...) kprintf(CRESET "[" RED component CRESET "]: " fmt, ##__VA_ARGS__) #else # define ERR(component, fmt, ...) kprintf("["component"]: "fmt, ##__VA_ARGS__) #endif #endif // KPRINTF_H_