Skip to content

Commit e300ece

Browse files
committed
enh(log) salvage TAG from ESP_IDF log-statements >
by converting result log-rows from the 1st line to the 2nd (`NET` is the tag): ``` [ 73419][D][telelogger.cpp:915] telemetry(): state: 33C [ 73419][D][telelogger.cpp:915] telemetry(): [NET] state: 33C ```
1 parent 6cfe461 commit e300ece

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Diff for: cores/esp32/esp32-hal-log.h

+10-10
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,16 @@ void log_print_buf(const uint8_t *b, size_t len);
206206
#undef ESP_EARLY_LOGD
207207
#undef ESP_EARLY_LOGV
208208

209-
#define ESP_LOGE(tag, ...) log_e(__VA_ARGS__)
210-
#define ESP_LOGW(tag, ...) log_w(__VA_ARGS__)
211-
#define ESP_LOGI(tag, ...) log_i(__VA_ARGS__)
212-
#define ESP_LOGD(tag, ...) log_d(__VA_ARGS__)
213-
#define ESP_LOGV(tag, ...) log_v(__VA_ARGS__)
214-
#define ESP_EARLY_LOGE(tag, ...) isr_log_e(__VA_ARGS__)
215-
#define ESP_EARLY_LOGW(tag, ...) isr_log_w(__VA_ARGS__)
216-
#define ESP_EARLY_LOGI(tag, ...) isr_log_i(__VA_ARGS__)
217-
#define ESP_EARLY_LOGD(tag, ...) isr_log_d(__VA_ARGS__)
218-
#define ESP_EARLY_LOGV(tag, ...) isr_log_v(__VA_ARGS__)
209+
#define ESP_LOGE(tag, format, ...) log_e("[" #tag "] " format, ##__VA_ARGS__)
210+
#define ESP_LOGW(tag, format, ...) log_w("[" #tag "] " format, ##__VA_ARGS__)
211+
#define ESP_LOGI(tag, format, ...) log_i("[" #tag "] " format, ##__VA_ARGS__)
212+
#define ESP_LOGD(tag, format, ...) log_d("[" #tag "] " format, ##__VA_ARGS__)
213+
#define ESP_LOGV(tag, format, ...) log_v("[" #tag "] " format, ##__VA_ARGS__)
214+
#define ESP_EARLY_LOGE(tag, format, ...) isr_log_e("[" tag "]" #format, ##__VA_ARGS__)
215+
#define ESP_EARLY_LOGW(tag, format, ...) isr_log_w("[" tag "]" #format, ##__VA_ARGS__)
216+
#define ESP_EARLY_LOGI(tag, format, ...) isr_log_i("[" tag "]" #format, ##__VA_ARGS__)
217+
#define ESP_EARLY_LOGD(tag, format, ...) isr_log_d("[" tag "]" #format, ##__VA_ARGS__)
218+
#define ESP_EARLY_LOGV(tag, format, ...) isr_log_v("[" tag "]" #format, ##__VA_ARGS__)
219219
#endif
220220
#endif
221221

0 commit comments

Comments
 (0)