Is there any way to disable logging messages for network transport wrapper implementation?

Hello All,

I need to disable logging messages in tcp_sockets_wrapper.c file as there is no custom printf function implemented in our application. Please let me know.

Link : https://github.com/FreeRTOS/FreeRTOS/blob/main/FreeRTOS-Plus/Source/Application-Protocols/network_transport/tcp_sockets_wrapper/ports/freertos_plus_tcp/tcp_sockets_wrapper.c

Thank you.

You mean Logging Functionality - FreeRTOS ?

Setting the Verbosity Level

To set the verbosity level define the LIBRARY_LOG_LEVEL macro to one of the following values in the same configuration file used to define SdkLog(). Valid values for LIBRARY_LOG_LEVEL are:

  • LOG_NONE (turns logging off)
  • LOG_ERROR
  • LOG_WARN
  • LOG_INFO
  • LOG_DEBUG

Hi @hs2 ,
Thank you for the response.

Correct I am talking about the same logging functionality.

The LIBRARY_LOG_LEVEL macro is already defined in the tcp_sockets_wrapper.c file itself. Also, seems like this file doesn’t include any user level configuration header file. Hence, I am finding challenging to disable it.

May you please suggest specifically in which file I will have to define the macro and how I can link that header file with tcp_sockets_wrapper.c file.

Thank you.

Sorry - I’m not familiar with the source package you’re using and also never used the TCP logging facility.

@hs2
No problem, thank you for looking into this request.

You are right. I think these lines should be moved here so that you can change logging level in FreeRTOSIPConfig.h.

Hi @aggarg ,
Thank you for confirming the issue.

  1. In that case, are you suggesting user to define LIBRARY_LOG_LEVEL macro in FreeRTOSConfig.h file. If we do it that way, then that configuration would be global and applies other libraries like coreHTTP, coreMQTT also as FreeRTOS.h is included, please check and confirm.

  2. In corePKCS11 Library (Link), looks like this macro definition is handled properly. Please refer below image, this library allows user to define LIBRARY_LOG_LEVEL macro to desired value in the user defined configuration file core_pkcs11_config.h

  3. As the reported issue is valid, do I need to create a GitHub issue for the further follow-up and fix or you will take care of this process please let me know.

Thank you.

I was suggesting FreeRTOSIpConfig.h so that only TCP related components are effected.

Yes, please create a GitHub issue and mention this thread in the issue.

You should also be able to control this by providing a “logging_stack.h” that stubs out the logging functionality.

This PR updates the tcp_sockets_wrapper.c to take the debug levels based on the configuration supplied from FreeRTOS Config/IPConfig files.

Hi @tony-josi-aws @aggarg ,
Much appreciated…!
Thank you for the quick support in fixing the issue.

1 Like