esp_iot_framework  v0.2.1
© 2026 AmakeSasha, distributed under a license Apache-2.0

Anything that does not belong to a specific section or is not part of a group large enough for a separate module. More...

Functions

size_t eif_core_log_pop_chunk (char *dest_buf, size_t max_size)
 Thread-safe extraction of diagnostic logs from the core ring buffer. More...
 

Detailed Description

Function Documentation

◆ eif_core_log_pop_chunk()

size_t eif_core_log_pop_chunk ( char *  dest_buf,
size_t  max_size 
)
Note
Only available if the Kconfig option CONFIG_EIF_CORE_LOG_ENABLE_REMOTE_DEBUG is enabled.

This function retrieves accumulated logs from the internal ring buffer, copies them into the provided destination buffer, and releases the consumed memory within the ring.

Parameters
dest_bufPointer to the destination buffer where logs will be copied.
max_sizeMaximum capacity of the destination buffer in bytes.
Returns
size_t The number of bytes actually copied into dest_buf. Returns 0 if the log buffer is empty.
#include <stdio.h>
#include <string.h>
#include <esp_iot_framework_core_ext.h>
void dump_core_logs(void) {
char log_buffer[256];
size_t bytes_popped = 0;
do {
memset(log_buffer, 0, sizeof(log_buffer));
bytes_popped = eif_core_log_pop_chunk(log_buffer, sizeof(log_buffer) - 1);
if (bytes_popped > 0) {
printf("%s", log_buffer);
}
} while (bytes_popped > 0);
}
size_t eif_core_log_pop_chunk(char *dest_buf, size_t max_size)
Thread-safe extraction of diagnostic logs from the core ring buffer.