16#define ANSI_ESC_SGR(_n) "\033[" _n "m"
17#define ANSI_ESC_RESET ANSI_ESC_SGR("0")
18#define ANSI_ESC_BOLD ANSI_ESC_SGR("1")
19#define ANSI_ESC_FAINT ANSI_ESC_SGR("2")
20#define ANSI_ESC_RED ANSI_ESC_SGR("31")
21#define ANSI_ESC_GREEN ANSI_ESC_SGR("32")
22#define ANSI_ESC_YELLOW ANSI_ESC_SGR("33")
23#define ANSI_ESC_BLUE ANSI_ESC_SGR("34")
24#define ANSI_ESC_GRAY ANSI_ESC_SGR("90")
26#if LOG_COLOR_ENABLED != 0
28#define F_BOLD(_str) ANSI_ESC_BOLD _str ANSI_ESC_RESET
29#define F_FAINT(_str) ANSI_ESC_FAINT _str ANSI_ESC_RESET
30#define F_RED(_str) ANSI_ESC_RED _str ANSI_ESC_RESET
31#define F_BLUE(_str) ANSI_ESC_BLUE _str ANSI_ESC_RESET
32#define F_YELLOW(_str) ANSI_ESC_YELLOW _str ANSI_ESC_RESET
33#define F_GRAY(_str) ANSI_ESC_GRAY _str ANSI_ESC_RESET
34#define F_GREEN(_str) ANSI_ESC_GREEN _str ANSI_ESC_RESET
36#define F_BOLD(_str) _str
37#define F_FAINT(_str) _str
38#define F_RED(_str) _str
39#define F_BLUE(_str) _str
40#define F_YELLOW(_str) _str
41#define F_GRAY(_str) _str
42#define F_GREEN(_str) _str
46#define VSNPRINTF vsnprintf
49static inline void log_printf(
const char *fstr, ...)
54 int len = VSNPRINTF(
buf,
sizeof(
buf), fstr, arg);
60#define LOG_PRINTF(...) log_printf(__VA_ARGS__)
61#define LOG_WRITE(_str) mmhal_log_write((const uint8_t *)_str, strlen(_str))
62#define LOG_FLUSH() mmhal_log_flush()
65#define STRINGIFY(x) #x
void mmhal_log_write(const uint8_t *data, size_t len)
Write to the debug log.
#define MMOSAL_ASSERT(expr)
Assert that the given expression evaluates to true and abort execution if not.
char buf[1408]
Statically allocated buffer for HTTP GET request, just under 1 packet size.