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.