khoih-prog / AsyncUDP_WT32_ETH01

Fully Asynchronous UDP Library for WT32_ETH01 (ESP32 + LAN8720). The library is easy to use and includes support for Unicast, Broadcast and Multicast environments.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logging in "Disable logging" mode

haakonnessjoen opened this issue · comments

#define ASYNC_UDP_LOG0(x) { ASYNC_UDP_PRINT(x); }

Why are these not disabled when the log level is 0 ?

It says that ASYNC_UDP_WT32_ETH01_LOGLEVEL 0 = DISABLED

But it still prints out "FULL_DUPLEX, 100Mbps" etc.

(btw, the library is awesome except from that tiny issue!)

To have to use either UDP_LOGERROR, UDP_LOGWARN, etc., instead of ASYNC_UDP_LOG, which is designed to print every time, no nmatter what _ASYNC_UDP_WT32_ETH01_LOGLEVEL_ is

The mentioned prints come from WebServer_WT32_ETH01 which this library relies on.

The informational display is intentional so that you can't remove even by _ETHERNET_WEBSERVER_LOGLEVEL_ = 0, unless you modify that library to delete / change those lines, if absolutely necessary.

https://github.com/khoih-prog/WebServer_WT32_ETH01/blob/811a7d27cb07998817eececd7dacdc16b2dbfc10/src/WebServer_WT32_ETH01_Impl.h#L76-L90

        ET_LOG3(F("ETH MAC: "), ETH.macAddress(), F(", IPv4: "), ETH.localIP());


        if (ETH.fullDuplex())
        {
          ET_LOG0(F("FULL_DUPLEX, "));
        }
        else
        {
          ET_LOG0(F("HALF_DUPLEX, "));
        }
        
        ET_LOG1(ETH.linkSpeed(), F("Mbps"));


        WT32_ETH01_eth_connected = true;
      }