Skip to content

Commit 121adaa

Browse files
odudexjgriffiths
authored andcommitted
libjade: accept non-literal tags in mocked ESP_LOG macros
k_quirc logs with a 'static const char* TAG' tag, which the mocked macros could not handle as they pasted the tag as a string literal. Print it via %s instead, fixing the libjade host build.
1 parent 32d3c9a commit 121adaa

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

components/cUR

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 057e419521a1348a98ace474516c24d6c6e90466

libjade/include/esp_log.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@ extern esp_log_level_t _libjade_log_level;
2121
#define ESP_LOGD(f, fmt, ...) \
2222
do { \
2323
if (_libjade_log_level <= ESP_LOG_DEBUG) \
24-
fprintf(stderr, "DEBUG:" f ":" fmt "\n", __VA_ARGS__); \
24+
fprintf(stderr, "DEBUG:%s:" fmt "\n", f, __VA_ARGS__); \
2525
} while (0)
2626
#define ESP_LOGI(f, fmt, ...) \
2727
do { \
2828
if (_libjade_log_level <= ESP_LOG_INFO) \
29-
fprintf(stderr, "INFO:" f ":" fmt "\n", __VA_ARGS__); \
29+
fprintf(stderr, "INFO:%s:" fmt "\n", f, __VA_ARGS__); \
3030
} while (0)
3131
#define ESP_LOGW(f, fmt, ...) \
3232
do { \
3333
if (_libjade_log_level <= ESP_LOG_WARN) \
34-
fprintf(stderr, "WARN:" f ":" fmt "\n", __VA_ARGS__); \
34+
fprintf(stderr, "WARN:%s:" fmt "\n", f, __VA_ARGS__); \
3535
} while (0)
3636
#define ESP_LOGE(f, fmt, ...) \
3737
do { \
3838
if (_libjade_log_level <= ESP_LOG_ERROR) \
39-
fprintf(stderr, "ERROR:" f ":" fmt "\n", __VA_ARGS__); \
39+
fprintf(stderr, "ERROR:%s:" fmt "\n", f, __VA_ARGS__); \
4040
} while (0)
4141

4242
#ifndef CONFIG_LOG_DEFAULT_LEVEL_NONE

0 commit comments

Comments
 (0)