Add timestamps to minimal logging

Hi we are working on a matter project using ncs v2.6.0

Currently we are running out of RAM memory and that´s why we have moved to minimal logging by enabling 

CONFIG_LOG_MODE_MINIMAL=y
Now we would like to add timestamps to the logs, but we don´t want to move to deferred logging because it takes too much more RAM.
Here my questions:
  • Is there a way to enable/add timestamps using minimal logging?
  • Is there a way to disable some features of deferred logging to keep it as minimal as possible but logging timestamps?

Thanks

Hugo

Parents
  • Hi, 

    Is there a way to enable/add timestamps using minimal logging?

    Are you using CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP or CONFIG_LOG_TIMESTAMP_64BIT? If so, see the configs dependencies

    Is there a way to disable some features of deferred logging to keep it as minimal as possible but logging timestamps?

    To minimize the memory usage of deferred logging, you can adjust the log level. Setting a higher default log level will reduce the number of log messages compiled into the firmware:

    CONFIG_LOG_DEFAULT_LEVEL=3  # Set to INFO level

    Logger module explains that logs can be filtered out based on module and severity level during compilation.

    You can also disable some features that you don't need, such as coloring:

    CONFIG_LOG_BACKEND_SHOW_COLOR=n

    If the above still cannot help, you might consider disabling some other features or Memory footprint optimization.

    Regards,
    Amanda H.

Reply
  • Hi, 

    Is there a way to enable/add timestamps using minimal logging?

    Are you using CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP or CONFIG_LOG_TIMESTAMP_64BIT? If so, see the configs dependencies

    Is there a way to disable some features of deferred logging to keep it as minimal as possible but logging timestamps?

    To minimize the memory usage of deferred logging, you can adjust the log level. Setting a higher default log level will reduce the number of log messages compiled into the firmware:

    CONFIG_LOG_DEFAULT_LEVEL=3  # Set to INFO level

    Logger module explains that logs can be filtered out based on module and severity level during compilation.

    You can also disable some features that you don't need, such as coloring:

    CONFIG_LOG_BACKEND_SHOW_COLOR=n

    If the above still cannot help, you might consider disabling some other features or Memory footprint optimization.

    Regards,
    Amanda H.

Children
Related