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
  • Hi Ole, SDK 12_2.0.

    Perhaps I am confused about the purpose and correct usage of these two config.h files?
    (Is there a note about correct usage in the documentation somewhere?)

    I have sdk_config.h that contains this fragment:

    //==========================================================
    // <e> NRF_LOG_ENABLED - nrf_log - Logging
    //==========================================================
    #ifndef NRF_LOG_ENABLED
    #define NRF_LOG_ENABLED 0
    #endif
    #if  NRF_LOG_ENABLED
    // <e> NRF_LOG_USES_COLORS ... etc
    

    I am compiling with the C flag -DUSE_APP_CONFIG and I have an app_config.h with these settings:

    #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
    #define NRF_LOG_DEFERRED 0
    #define NRF_LOG_BACKEND_MAX_STRING_LENGTH 128
    #define NRF_LOG_USES_TIMESTAMP 0
    #define NRF_LOG_TIMESTAMP_DIGITS  10
    #define NRF_LOG_USES_COLORS 1
    #define NRF_LOG_INFO_COLOR 0
    #define NRF_LOG_ERROR_COLOR 2
    #define NRF_LOG_DEBUG_COLOR 4
    #define NRF_LOG_WARNING_COLOR 7
    
Reply
  • Hi Ole, SDK 12_2.0.

    Perhaps I am confused about the purpose and correct usage of these two config.h files?
    (Is there a note about correct usage in the documentation somewhere?)

    I have sdk_config.h that contains this fragment:

    //==========================================================
    // <e> NRF_LOG_ENABLED - nrf_log - Logging
    //==========================================================
    #ifndef NRF_LOG_ENABLED
    #define NRF_LOG_ENABLED 0
    #endif
    #if  NRF_LOG_ENABLED
    // <e> NRF_LOG_USES_COLORS ... etc
    

    I am compiling with the C flag -DUSE_APP_CONFIG and I have an app_config.h with these settings:

    #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
    #define NRF_LOG_DEFERRED 0
    #define NRF_LOG_BACKEND_MAX_STRING_LENGTH 128
    #define NRF_LOG_USES_TIMESTAMP 0
    #define NRF_LOG_TIMESTAMP_DIGITS  10
    #define NRF_LOG_USES_COLORS 1
    #define NRF_LOG_INFO_COLOR 0
    #define NRF_LOG_ERROR_COLOR 2
    #define NRF_LOG_DEBUG_COLOR 4
    #define NRF_LOG_WARNING_COLOR 7
    
Children
No Data
Related