I want to enable the Logger Module to have the high default severity of Error and then be able to enable lower level severities on an individual module for debugging. Is this possible with the current API?
I want to enable the Logger Module to have the high default severity of Error and then be able to enable lower level severities on an individual module for debugging. Is this possible with the current API?
Hi Darren
No, this is not possible without changing the logger API.
If you take a look at the implementation in nrf_log_internal.h you can see that the log messages will only be included if both the default log level and the module specific log level is lower or equal to that of the current message.
Best regards
Torbjørn
Torbjon,
Can you comment on why that choice was made it seems to me this makes the logger module less useful? Would Nordic consider changing the API to include the operation I have outlined above?
Thanks, Darren
Hi Darren
I will check with the guy that wrote the library. He has been unavailable all day, but as soon as I get in touch with him I will get back to you ;)
Hi again
Apparently the idea was to be able to limit the logs globally, without having to change every module, rather than being able to give one module a lower log level than the default.
As he pointed out you could change the nrf_log_internal.h file easily to work the way you propose, by changing the && to || inside the various NRF_LOG_INTERNAL_.... macros in nrf_log_internal.h (between lines 99 to 164).
Torbjorn,
Thanks for taking the time to look into this and provide me an answer! As your collegue pointed out I already changed the macros in the file from && to || and changed
#ifndef NRF_LOG_LEVEL
#define NRF_LOG_LEVEL NRF_LOG_DEFAULT_LEVEL
#endif
to
#ifndef NRF_LOG_LEVEL
#define NRF_LOG_LEVEL 0
#endif
As usual the Nordic support team is great!
Cheers, Darren