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

disable logging

I want to disable logging (which is working OK). In my app.config.h I have set the following:

#undef NRF_LOG_ENABLED
#define NRF_LOG_BACKEND_SERIAL_USES_UART 0
#define NRF_LOG_BACKEND_SERIAL_USES_RTT 1
#define NRF_LOG_DEFAULT_LEVEL 4

Now I get this during linking:

...../../../main.c:130: undefined reference to `nrf_log_frontend_std_0'
...../../../main.c:134: undefined reference to `nrf_log_frontend_std_1'

What have I forgotten please?

Parents
  • Thanks for the feedback. Relieved to hear it is actually a bit confusing, and not my stupidity.
    So to clarify for other readers: (verified by my own experiments)

    To disable all logging:

    #define NRF_LOG_DEFAULT_LEVEL 0
    

    Any definition, or undefinition of NRF_LOG_ENABLED is irrelevant.

    Indeed if NRF_LOG_ENABLED=0 or is undefined, and NRF_LOG_DEFAULT_LEVEL >0 then linker errors will occur.

Reply
  • Thanks for the feedback. Relieved to hear it is actually a bit confusing, and not my stupidity.
    So to clarify for other readers: (verified by my own experiments)

    To disable all logging:

    #define NRF_LOG_DEFAULT_LEVEL 0
    

    Any definition, or undefinition of NRF_LOG_ENABLED is irrelevant.

    Indeed if NRF_LOG_ENABLED=0 or is undefined, and NRF_LOG_DEFAULT_LEVEL >0 then linker errors will occur.

Children
No Data
Related