- char buf_string[32 * 3 + 1]; \
- int buf_string_pos = 0; \
- for (int i = 0; i < len; i++) { \
- buf_string_pos += sprintf(buf_string + buf_string_pos, " %02x", buf[i]); \
- if (i % 32 == 32 - 1) { \
- LOG_DEBUG("%s", buf_string); \
- buf_string_pos = 0; \
+ if (LOG_LEVEL_IS(LOG_LVL_DEBUG_IO)) { \
+ char buf_string[32 * 3 + 1]; \
+ int buf_string_pos = 0; \
+ for (int i = 0; i < len; i++) { \
+ buf_string_pos += sprintf(buf_string + buf_string_pos, " %02x", buf[i]); \
+ if (i % 32 == 32 - 1) { \
+ LOG_DEBUG_IO("%s", buf_string); \
+ buf_string_pos = 0; \
+ } \