38 #include <csp/csp_types.h> 48 #define KLOG_MAX_LINE 255 51 #define KLOG(level, logger, ...) klog_write(level, logger, __VA_ARGS__) 52 #define KLOG_ERR(logger, ...) KLOG(LOG_ERROR, logger, __VA_ARGS__) 53 #define KLOG_WARN(logger, ...) KLOG(LOG_WARNING, logger, __VA_ARGS__) 54 #define KLOG_INFO(logger, ...) KLOG(LOG_INFO, logger, __VA_ARGS__) 55 #define KLOG_DEBUG(logger, ...) KLOG(LOG_DEBUG, logger, __VA_ARGS__) 57 #define KLOG_SUFFIX_LEN 4 58 #define KLOG_PATH_LEN 255 59 #define KLOG_MAX_PATH (KLOG_PATH_LEN - KLOG_SUFFIX_LEN - 1) 61 #define KLOG_PART_SIZE_DEFAULT (1024 * 512) 62 #define KLOG_MAX_PARTS_DEFAULT 4 69 uint32_t part_size, uint8_t max_parts);
71 void klog_console(
unsigned level,
const char *logger,
const char *format, ...);
72 void klog_file(
unsigned level,
const char *logger,
const char *format, ...);
75 #define klog_write(level, logger, ...) do { \ 76 if (level <= klog_console_level) { \ 77 klog_console(level, logger, __VA_ARGS__); \ 79 if (level <= klog_file_level && klog_file_logging) { \ 80 klog_file(level, logger, __VA_ARGS__); \
void klog_console(unsigned level, const char *logger, const char *format,...)
void klog_file(unsigned level, const char *logger, const char *format,...)
uint8_t klog_console_level
int klog_init_file(char *file_path, uint8_t file_path_len, uint32_t part_size, uint8_t max_parts)