Logger backend interface

nRF5 SDK v16.0.0

The nrf_log backend interface. More...

Data Structures

struct nrf_log_backend_api_t
Logger backend API. More...
struct nrf_log_backend_cb_t
Logger backend control block. More...
struct nrf_log_backend_s
Logger backend structure. More...

Macros

#define NRF_LOG_BACKEND_SECTION_NAME log_backends
#define NRF_LOG_BACKEND_SUBSECTION_NAME (_name)   NRF_LOG_BACKEND_SECTION_NAME
#define NRF_LOG_BACKEND_INVALID_ID 0xFF
Invalid ID value indicating that logger backend is not attached to the logger frontend.
#define NRF_LOG_BACKEND_DEF (_name, _api, _p_ctx)
Macro for creating a logger backend instance. More...

Typedefs

typedef void nrf_log_entry_t
nrf_log entry.
typedef struct nrf_log_backend_s nrf_log_backend_t

Functions

NRF_SECTION_DEF (log_backends, nrf_log_backend_t )
Memory section where backends are located.
__STATIC_INLINE void nrf_log_backend_put ( nrf_log_backend_t const *const p_backend, nrf_log_entry_t *p_msg)
Function for putting message with log entry to the backend. More...
__STATIC_INLINE void nrf_log_backend_panic_set ( nrf_log_backend_t const *const p_backend)
Function for reconfiguring backend to panic mode. More...
__STATIC_INLINE void nrf_log_backend_flush ( nrf_log_backend_t const *const p_backend)
Function for flushing backend. More...
__STATIC_INLINE void nrf_log_backend_id_set ( nrf_log_backend_t const *const p_backend, uint8_t id)
Function for setting backend id. More...
__STATIC_INLINE uint8_t nrf_log_backend_id_get ( nrf_log_backend_t const *const p_backend)
Function for getting backend id. More...
__STATIC_INLINE void nrf_log_backend_enable ( nrf_log_backend_t const *const p_backend)
Function for enabling backend. More...
__STATIC_INLINE void nrf_log_backend_disable ( nrf_log_backend_t const *const p_backend)
Function for disabling backend. More...
__STATIC_INLINE bool nrf_log_backend_is_enabled ( nrf_log_backend_t const *const p_backend)
Function for checking state of the backend. More...

Detailed Description

The nrf_log backend interface.

Macro Definition Documentation

#define NRF_LOG_BACKEND_DEF ( _name,
_api,
_p_ctx
)
Value:
static nrf_log_backend_cb_t CONCAT_2 (log_backend_cb_, _name) = { \
.enabled = false , \
.p_next = NULL \
}; \
NRF_SECTION_ITEM_REGISTER(NRF_LOG_BACKEND_SUBSECTION_NAME(_name), \
static const nrf_log_backend_t _name) = { \
.p_api = &_api, \
.p_ctx = _p_ctx, \
.p_cb = & CONCAT_2 (log_backend_cb_, _name), \
.p_name = ( char *)STRINGIFY(_name) \
}

Macro for creating a logger backend instance.

Parameters
_name Name of the backend instance.
_api Logger backend API.
_p_ctx Pointer to the user context.

Function Documentation

__STATIC_INLINE void nrf_log_backend_disable ( nrf_log_backend_t const *const p_backend )

Function for disabling backend.

Parameters
[in] p_backend Pointer to the backend instance.
__STATIC_INLINE void nrf_log_backend_enable ( nrf_log_backend_t const *const p_backend )

Function for enabling backend.

Parameters
[in] p_backend Pointer to the backend instance.
__STATIC_INLINE void nrf_log_backend_flush ( nrf_log_backend_t const *const p_backend )

Function for flushing backend.

   On flushing request backend should release log message(s).
Parameters
[in] p_backend Pointer to the backend instance.
__STATIC_INLINE uint8_t nrf_log_backend_id_get ( nrf_log_backend_t const *const p_backend )

Function for getting backend id.

Note
It is used internally by the logger.
Parameters
[in] p_backend Pointer to the backend instance.
Returns
Id.
__STATIC_INLINE void nrf_log_backend_id_set ( nrf_log_backend_t const *const p_backend ,
uint8_t id
)

Function for setting backend id.

Note
It is used internally by the logger.
Parameters
[in] p_backend Pointer to the backend instance.
[in] id Id.
__STATIC_INLINE bool nrf_log_backend_is_enabled ( nrf_log_backend_t const *const p_backend )

Function for checking state of the backend.

Parameters
[in] p_backend Pointer to the backend instance.
Returns
True if backend is enabled, false otherwise.
__STATIC_INLINE void nrf_log_backend_panic_set ( nrf_log_backend_t const *const p_backend )

Function for reconfiguring backend to panic mode.

Parameters
[in] p_backend Pointer to the backend instance.
__STATIC_INLINE void nrf_log_backend_put ( nrf_log_backend_t const *const p_backend ,
nrf_log_entry_t * p_msg
)

Function for putting message with log entry to the backend.

Parameters
[in] p_backend Pointer to the backend instance.
[in] p_msg Pointer to message with log entry.