This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF_LOG_ERROR should be coded not NRF_LOG_DEBUG for error conditions

NRF_LOG_ERROR should be coded not NRF_LOG_DEBUG for error conditions.

Not only will the log calls not be compiled and not displayed if 

NRF_LOG_DEFAULT_LEVEL  is less than 4

but also presenting. DEBUG: xxx messages are misleading where they are really ERRORs
(actualy they should be  emerg, panic, alert or crit but there are no such levels for nRF_LOG)

There are many cases of this.

For example from nRF5_SDK_15.0.0_a53641a/components/libraries/bootloader/dfu/nrf_dfu_utils.c

NRF_LOG_DEBUG("Return false in valid app check");
NRF_LOG_DEBUG("Return false in CRC");
NRF_LOG_WARNING("Aborting. Cannot fit new firmware on device");
NRF_LOG_DEBUG("Invalidating SoftDevice.");

These  should be

NRF_LOG_ERROR("Return false in valid app check");
NRF_LOG_ERROR("Return false in CRC");
NRF_LOG_ERROR("Aborting. Cannot fit new firmware on device");
NRF_LOG_ERROR("Invalidating SoftDevice.");

Thank you.

  • Hi Dennis, 

    the we've tried to reduce the size of the bootloader as much as possible, hence a lot of the logging calls have been set to the debug level rather than error. I also think that our developers will not view some of the cases as errors, but debug information, but this is subjective. 

    I will forward your feedback to the developers through our internal issues database. They will then review the feedback in the next development cycle. 

    Best regards

    Bjørn  

Related