28 lines
748 B
C
28 lines
748 B
C
#ifndef KPRINTF_H_
|
|
#define KPRINTF_H_
|
|
|
|
#include <printf/printf.h>
|
|
|
|
#define kprintf printf_
|
|
#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_
|