Files

21 lines
719 B
C
Raw Permalink Normal View History

2026-04-09 10:14:20 +08:00
#pragma once
#include <stdarg.h>
#include <stdint.h>
typedef enum {
LOG_LVL_ERROR = 0,
LOG_LVL_WARN = 1,
LOG_LVL_INFO = 2,
LOG_LVL_DEBUG = 3,
} log_level_t;
void log_rtt_set_level(log_level_t lvl);
void log_rtt_printf(log_level_t lvl, const char* tag, const char* fmt, ...);
void log_rtt_init(void);
void log_hex_frame(const char * tag , const uint8_t* data, uint16_t len);
#define LOGE(tag, fmt, ...) log_rtt_printf(LOG_LVL_ERROR, tag, fmt, ##__VA_ARGS__)
#define LOGW(tag, fmt, ...) log_rtt_printf(LOG_LVL_WARN, tag, fmt, ##__VA_ARGS__)
#define LOGI(tag, fmt, ...) log_rtt_printf(LOG_LVL_INFO, tag, fmt, ##__VA_ARGS__)
#define LOGD(tag, fmt, ...) log_rtt_printf(LOG_LVL_DEBUG, tag, fmt, ##__VA_ARGS__)