37#define ERROR_LOG_MAX_ENTRIES 50
38#define ERROR_LOG_LINE_LEN 100
68void log_write(log_level_t level,
const char* tag,
const char* fmt, ...);
71void log_raw(
const char* fmt, ...);
74void log_hex(
const char* tag,
const char* label,
const uint8_t* data,
size_t len);
145#define LOG_E(tag, fmt, ...) log_write(CDC_LOG_LEVEL_ERROR, tag, fmt, ##__VA_ARGS__)
146#define LOG_W(tag, fmt, ...) log_write(CDC_LOG_LEVEL_WARN, tag, fmt, ##__VA_ARGS__)
147#define LOG_I(tag, fmt, ...) log_write(CDC_LOG_LEVEL_INFO, tag, fmt, ##__VA_ARGS__)
148#define LOG_D(tag, fmt, ...) log_write(CDC_LOG_LEVEL_DEBUG, tag, fmt, ##__VA_ARGS__)
149#define LOG_V(tag, fmt, ...) log_write(CDC_LOG_LEVEL_VERBOSE, tag, fmt, ##__VA_ARGS__)
152#define LOGE(fmt, ...) LOG_E("APP", fmt, ##__VA_ARGS__)
153#define LOGW(fmt, ...) LOG_W("APP", fmt, ##__VA_ARGS__)
154#define LOGI(fmt, ...) LOG_I("APP", fmt, ##__VA_ARGS__)
155#define LOGD(fmt, ...) LOG_D("APP", fmt, ##__VA_ARGS__)
156#define LOGV(fmt, ...) LOG_V("APP", fmt, ##__VA_ARGS__)
int(* console_input_getchar_hook_t)(void)
Input getchar hook used to fetch one character from an additional source.
size_t error_log_get_entries(error_log_entry_t *entries, size_t max_entries)
Copies stored error-log entries in chronological order.
void log_init(void)
Logging API implementation.
size_t error_log_get_count(void)
Returns number of buffered error-log entries.
int console_getchar(void)
Reads one character from available console input source.
void console_register_input_hook(console_input_available_hook_t avail_hook, console_input_getchar_hook_t getchar_hook)
Registers the console input hooks (only one set supported at a time).
log_level_t log_get_level(void)
Returns current log verbosity threshold.
bool console_available(void)
Returns whether any console input source has pending data.
void console_printf(const char *fmt,...)
Formatted write helper for console output.
void error_log_dump(void)
Dumps buffered error-log entries to console.
void log_set_level(log_level_t level)
Sets runtime log verbosity threshold.
void log_write(log_level_t level, const char *tag, const char *fmt,...)
Writes formatted tagged log line with optional suppression.
void console_print(const char *str)
Writes string to active console outputs.
void console_register_output_hook(console_output_hook_t hook)
Registers the console output hook (only one supported at a time).
void console_flush(void)
Flushes buffered console output transports.
bool(* log_authgate_hook_t)(void)
Hook polled before INFO/DEBUG/VERBOSE log lines reach the console.
void(* console_output_hook_t)(const char *data, size_t len)
Output hook called for every console output.
void log_register_authgate_hook(log_authgate_hook_t hook)
Registers (or clears) the auth-gate hook for INFO/DEBUG/VERBOSE.
void console_putchar(char c)
Writes single character to active console outputs.
void console_init(void)
Initializes console I/O transport state.
bool(* console_input_available_hook_t)(void)
Input-available hook used to check if additional input is available.
void error_log_clear(void)
Clears error-log ring buffer state.
void log_raw(const char *fmt,...)
Writes untagged raw formatted text to console.
#define ERROR_LOG_LINE_LEN
void log_hex(const char *tag, const char *label, const uint8_t *data, size_t len)
Logs binary buffer as grouped hexadecimal bytes.