Implement ESP_LOGx override option

Usable for library developers who write code not dependent on Arduino.
Adding 3 lines to the includes will permit their debug messages to be
visible in Arduino IDE or when enabled under IDF
This commit is contained in:
me-no-dev
2017-10-14 00:06:55 +03:00
parent c8ffcacd64
commit 409c75da04
5 changed files with 41 additions and 0 deletions

View File

@ -107,6 +107,22 @@ int log_printf(const char *fmt, ...);
#define log_e(format, ...)
#endif
#ifdef CONFIG_ARDUHAL_ESP_LOG
#include "esp_log.h"
#undef ESP_LOGE
#undef ESP_LOGW
#undef ESP_LOGI
#undef ESP_LOGD
#undef ESP_LOGV
#define ESP_LOGE(tag, ...) log_e(__VA_ARGS__)
#define ESP_LOGW(tag, ...) log_w(__VA_ARGS__)
#define ESP_LOGI(tag, ...) log_i(__VA_ARGS__)
#define ESP_LOGD(tag, ...) log_d(__VA_ARGS__)
#define ESP_LOGV(tag, ...) log_v(__VA_ARGS__)
#endif
#ifdef __cplusplus
}
#endif