17 FuriLogLevelDefault = 0,
19 FuriLogLevelError = 2,
22 FuriLogLevelDebug = 5,
23 FuriLogLevelTrace = 6,
26#define _FURI_LOG_CLR(clr) "\033[0;" clr "m"
27#define _FURI_LOG_CLR_RESET "\033[0m"
29#define _FURI_LOG_CLR_BLACK "30"
30#define _FURI_LOG_CLR_RED "31"
31#define _FURI_LOG_CLR_GREEN "32"
32#define _FURI_LOG_CLR_BROWN "33"
33#define _FURI_LOG_CLR_BLUE "34"
34#define _FURI_LOG_CLR_PURPLE "35"
36#define _FURI_LOG_CLR_E _FURI_LOG_CLR(_FURI_LOG_CLR_RED)
37#define _FURI_LOG_CLR_W _FURI_LOG_CLR(_FURI_LOG_CLR_BROWN)
38#define _FURI_LOG_CLR_I _FURI_LOG_CLR(_FURI_LOG_CLR_GREEN)
39#define _FURI_LOG_CLR_D _FURI_LOG_CLR(_FURI_LOG_CLR_BLUE)
40#define _FURI_LOG_CLR_T _FURI_LOG_CLR(_FURI_LOG_CLR_PURPLE)
42typedef void (*FuriLogHandlerCallback)(
const uint8_t* data,
size_t size,
void* context);
45 FuriLogHandlerCallback callback;
89 _ATTRIBUTE((__format__(__printf__, 3, 4)));
98 _ATTRIBUTE((__format__(__printf__, 2, 3)));
136#define FURI_LOG_E(tag, format, ...) \
137 furi_log_print_format(FuriLogLevelError, tag, format, ##__VA_ARGS__)
138#define FURI_LOG_W(tag, format, ...) \
139 furi_log_print_format(FuriLogLevelWarn, tag, format, ##__VA_ARGS__)
140#define FURI_LOG_I(tag, format, ...) \
141 furi_log_print_format(FuriLogLevelInfo, tag, format, ##__VA_ARGS__)
142#define FURI_LOG_D(tag, format, ...) \
143 furi_log_print_format(FuriLogLevelDebug, tag, format, ##__VA_ARGS__)
144#define FURI_LOG_T(tag, format, ...) \
145 furi_log_print_format(FuriLogLevelTrace, tag, format, ##__VA_ARGS__)
152#define FURI_LOG_RAW_E(format, ...) \
153 furi_log_print_raw_format(FuriLogLevelError, format, ##__VA_ARGS__)
154#define FURI_LOG_RAW_W(format, ...) \
155 furi_log_print_raw_format(FuriLogLevelWarn, format, ##__VA_ARGS__)
156#define FURI_LOG_RAW_I(format, ...) \
157 furi_log_print_raw_format(FuriLogLevelInfo, format, ##__VA_ARGS__)
158#define FURI_LOG_RAW_D(format, ...) \
159 furi_log_print_raw_format(FuriLogLevelDebug, format, ##__VA_ARGS__)
160#define FURI_LOG_RAW_T(format, ...) \
161 furi_log_print_raw_format(FuriLogLevelTrace, format, ##__VA_ARGS__)
bool furi_log_remove_handler(FuriLogHandler handler)
Remove log TX callback.
Definition log.c:67
void furi_log_puts(const char *data)
Transmit data through log IO callbacks.
Definition log.c:105
void furi_log_print_format(FuriLogLevel level, const char *tag, const char *format,...) _ATTRIBUTE((__format__(__printf__
Print log record.
void void furi_log_print_raw_format(FuriLogLevel level, const char *format,...) _ATTRIBUTE((__format__(__printf__
Print log record.
void furi_log_tx(const uint8_t *data, size_t size)
Transmit data through log IO callbacks.
Definition log.c:88
bool furi_log_add_handler(FuriLogHandler handler)
Add log TX callback.
Definition log.c:41
void furi_log_init(void)
Initialize logging.
Definition log.c:34
bool furi_log_level_to_string(FuriLogLevel level, const char **str)
Log level to string.
Definition log.c:200
bool furi_log_level_from_string(const char *str, FuriLogLevel *level)
Log level from string.
Definition log.c:210
FuriLogLevel furi_log_get_level(void)
Get log level.
Definition log.c:196
void void void furi_log_set_level(FuriLogLevel level)
Set log level.
Definition log.c:187