mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'feature/lwip_logs_through_ESP_LOG_interface' into 'master'
feature/add option to route LWIP logs through ESP_LOG interface Closes IDFGH-7186 See merge request espressif/esp-idf!17893
This commit is contained in:
commit
37a1bf3a6f
@ -998,6 +998,13 @@ menu "LWIP"
|
||||
|
||||
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
|
||||
bool "Enable netif debug messages"
|
||||
depends on LWIP_DEBUG
|
||||
|
@ -85,7 +85,15 @@ typedef int sys_prot_t;
|
||||
|
||||
#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)
|
||||
#endif
|
||||
|
||||
#ifdef NDEBUG
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user