Flash logger backend. More...
Modules | |
Log flash backend configuration | |
Data Structures | |
struct | nrf_log_backend_flashlog_t |
Flashlog logger backend structure. More... | |
struct | nrf_log_backend_crashlog_t |
Crashlog logger backend structure. More... | |
Macros | |
#define | NRF_LOG_BACKEND_FLASHLOG_DEF(_name) NRF_LOG_BACKEND_DEF(_name, nrf_log_backend_flashlog_api, NULL) |
Macro for creating an instance of the flashlog logger backend. | |
#define | NRF_LOG_BACKEND_CRASHLOG_DEF(_name) NRF_LOG_BACKEND_DEF(_name, nrf_log_backend_crashlog_api, NULL) |
Macro for creating an instance of the crashlog logger backend. | |
Functions | |
ret_code_t | nrf_log_backend_flash_init (nrf_fstorage_api_t const *p_fs_api) |
Function for initializing the flash logger backend. More... | |
ret_code_t | nrf_log_backend_flash_next_entry_get (uint32_t *p_token, nrf_log_header_t **pp_header, uint8_t **pp_data) |
Function for getting a log entry stored in flash. More... | |
ret_code_t | nrf_log_backend_flash_erase (void) |
Function for erasing flash area dedicated for the flash logger backend. | |
Variables | |
const nrf_log_backend_api_t | nrf_log_backend_flashlog_api |
Flashlog logger backend API. | |
const nrf_log_backend_api_t | nrf_log_backend_crashlog_api |
Crashlog logger backend API. | |
Flash logger backend.
ret_code_t nrf_log_backend_flash_init | ( | nrf_fstorage_api_t const * | p_fs_api | ) |
Function for initializing the flash logger backend.
Flash logger backend consists of two logical backends: flashlog and crashlog. Since both backends write to the same flash area, the initialization is common.
p_fs_api | fstorage API to be used. |
ret_code_t nrf_log_backend_flash_next_entry_get | ( | uint32_t * | p_token, |
nrf_log_header_t ** | pp_header, | ||
uint8_t ** | pp_data | ||
) |
Function for getting a log entry stored in flash.
Log messages stored in flash can be read one by one starting from the oldest one.
[in,out] | p_token | Token reused between consecutive readings of log entries. Token must be set to 0 to read the first entry. |
[out] | pp_header | Pointer to the entry header. |
[out] | pp_data | Pointer to the data part of the entry (arguments or data in case of hexdump). |
NRF_SUCCESS | Entry was successfully read. |
NRF_ERROR_NOT_SUPPORTED | fstorage API does not support direct reading. |
NRF_ERROR_NOT_FOUND | Entry not found. Last entry was already reached or area is empty. |