Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
Logger backend interface. More...
Modules | |
Logger multidomain backend helpers | |
Logger multidomain backend helpers. | |
Data Structures | |
union | log_backend_evt_arg |
Argument(s) for backend events. More... | |
struct | log_backend_api |
Logger backend API. More... | |
struct | log_backend_control_block |
Logger backend control block. More... | |
struct | log_backend |
Logger backend structure. More... | |
Macros | |
#define | LOG_BACKEND_DEFINE(_name, _api, _autostart, ...) |
Macro for creating a logger backend instance. | |
Enumerations | |
enum | log_backend_evt { LOG_BACKEND_EVT_PROCESS_THREAD_DONE , LOG_BACKEND_EVT_MAX } |
Backend events. More... | |
Functions | |
static void | log_backend_init (const struct log_backend *const backend) |
Initialize or initiate the logging backend. | |
static int | log_backend_is_ready (const struct log_backend *const backend) |
Poll for backend readiness. | |
static void | log_backend_msg_process (const struct log_backend *const backend, union log_msg_generic *msg) |
Process message. | |
static void | log_backend_dropped (const struct log_backend *const backend, uint32_t cnt) |
Notify backend about dropped log messages. | |
static void | log_backend_panic (const struct log_backend *const backend) |
Reconfigure backend to panic mode. | |
static void | log_backend_id_set (const struct log_backend *const backend, uint8_t id) |
Set backend id. | |
static uint8_t | log_backend_id_get (const struct log_backend *const backend) |
Get backend id. | |
static const struct log_backend * | log_backend_get (uint32_t idx) |
Get backend. | |
static int | log_backend_count_get (void) |
Get number of backends. | |
static void | log_backend_activate (const struct log_backend *const backend, void *ctx) |
Activate backend. | |
static void | log_backend_deactivate (const struct log_backend *const backend) |
Deactivate backend. | |
static bool | log_backend_is_active (const struct log_backend *const backend) |
Check state of the backend. | |
static int | log_backend_format_set (const struct log_backend *backend, uint32_t log_type) |
Set logging format. | |
static void | log_backend_notify (const struct log_backend *const backend, enum log_backend_evt event, union log_backend_evt_arg *arg) |
Notify a backend of an event. | |
Logger backend interface.
#define LOG_BACKEND_DEFINE | ( | _name, | |
_api, | |||
_autostart, | |||
... | |||
) |
#include <include/zephyr/logging/log_backend.h>
Macro for creating a logger backend instance.
_name | Name of the backend instance. |
_api | Logger backend API. |
_autostart | If true backend is initialized and activated together with the logger subsystem. |
... | Optional context. |
enum log_backend_evt |
#include <include/zephyr/logging/log_backend.h>
Backend events.
|
inlinestatic |
#include <include/zephyr/logging/log_backend.h>
Activate backend.
[in] | backend | Pointer to the backend instance. |
[in] | ctx | User context. |
|
inlinestatic |
|
inlinestatic |
#include <include/zephyr/logging/log_backend.h>
Deactivate backend.
[in] | backend | Pointer to the backend instance. |
|
inlinestatic |
#include <include/zephyr/logging/log_backend.h>
Notify backend about dropped log messages.
Function is optional.
[in] | backend | Pointer to the backend instance. |
[in] | cnt | Number of dropped logs since last notification. |
|
inlinestatic |
#include <include/zephyr/logging/log_backend.h>
Set logging format.
backend | Pointer to the backend instance. |
log_type | Log format. |
-ENOTSUP | If the backend does not support changing format types. |
-EINVAL | If the input is invalid. |
0 | for success. |
|
inlinestatic |
#include <include/zephyr/logging/log_backend.h>
Get backend.
[in] | idx | Pointer to the backend instance. |
|
inlinestatic |
#include <include/zephyr/logging/log_backend.h>
Get backend id.
[in] | backend | Pointer to the backend instance. |
|
inlinestatic |
#include <include/zephyr/logging/log_backend.h>
Set backend id.
backend | Pointer to the backend instance. |
id | ID. |
|
inlinestatic |
#include <include/zephyr/logging/log_backend.h>
Initialize or initiate the logging backend.
If backend initialization takes longer time it could block logging thread if backend is autostarted. That is because all backends are initialized in the context of the logging thread. In that case, backend shall provide function for polling for readiness (log_backend_is_ready).
[in] | backend | Pointer to the backend instance. |
|
inlinestatic |
#include <include/zephyr/logging/log_backend.h>
Check state of the backend.
[in] | backend | Pointer to the backend instance. |
|
inlinestatic |
#include <include/zephyr/logging/log_backend.h>
Poll for backend readiness.
If backend is ready immediately after initialization then backend may not provide this function.
[in] | backend | Pointer to the backend instance. |
0 | if backend is ready. |
-EBUSY | if backend is not yet ready. |
|
inlinestatic |
#include <include/zephyr/logging/log_backend.h>
Process message.
Function is used in deferred and immediate mode. On return, message content is processed by the backend and memory can be freed.
[in] | backend | Pointer to the backend instance. |
[in] | msg | Pointer to message with log entry. |
|
inlinestatic |
#include <include/zephyr/logging/log_backend.h>
Notify a backend of an event.
backend | Pointer to the backend instance. |
event | Event to be notified. |
arg | Pointer to the argument(s). |
|
inlinestatic |
#include <include/zephyr/logging/log_backend.h>
Reconfigure backend to panic mode.
[in] | backend | Pointer to the backend instance. |