add option to route LWIP logs through ESP_LOG interface

Signed-off-by: xueyunfei <xueyunfei@espressif.com>

Merges https://github.com/espressif/esp-idf/pull/8785
Closes https://github.com/espressif/esp-idf/issues/8361
pull/9422/head
Jeff H 2022-04-16 19:23:48 -07:00 zatwierdzone przez xueyunfei
rodzic 3e7aefd9fe
commit 101762718a
2 zmienionych plików z 15 dodań i 0 usunięć

Wyświetl plik

@ -1018,6 +1018,13 @@ menu "LWIP"
All lwIP debug features increase the size of the final binary. All lwIP debug features increase the size of the final binary.
config LWIP_DEBUG_ESP_LOG
bool "Route LWIP debugs through ESP_LOG interface"
depends on LWIP_DEBUG
default n
help
Enabling this option routes all enabled LWIP debugs through ESP_LOGD.
config LWIP_NETIF_DEBUG config LWIP_NETIF_DEBUG
bool "Enable netif debug messages" bool "Enable netif debug messages"
depends on LWIP_DEBUG depends on LWIP_DEBUG

Wyświetl plik

@ -79,7 +79,15 @@ typedef int sys_prot_t;
#include <stdio.h> #include <stdio.h>
#ifdef CONFIG_LWIP_DEBUG_ESP_LOG
// lwip debugs routed to ESP_LOGD
#include "esp_log.h"
#define LWIP_ESP_LOG_FUNC(format, ...) ESP_LOG_LEVEL(ESP_LOG_DEBUG, "lwip", format, ##__VA_ARGS__)
#define LWIP_PLATFORM_DIAG(x) LWIP_ESP_LOG_FUNC x
#else
// lwip debugs routed to printf
#define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0) #define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0)
#endif
#ifdef NDEBUG #ifdef NDEBUG