Composition Root API for wiring the logger_default adapter.
More...


Go to the source code of this file.
Functions | |
| logger_default_cfg_t | logger_default_default_cfg (void) |
Return a default configuration for the logger_default adapter. | |
| logger_default_env_t | logger_default_default_env (stream_t *stream, const osal_time_ops_t *time_ops, const osal_mem_ops_t *adapter_mem, const logger_env_t *port_env) |
Build a default environment for the logger_default adapter. | |
| logger_status_t | logger_default_create_logger (logger_t **out, const logger_default_cfg_t *cfg, const logger_default_env_t *env) |
Create a logger instance backed by the logger_default adapter. | |
This header exposes the CR-facing entry points used to:
logger_default configuration and environment values,logger_default adapter. Definition in file logger_default_cr_api.h.
| logger_status_t logger_default_create_logger | ( | logger_t ** | out, |
| const logger_default_cfg_t * | cfg, | ||
| const logger_default_env_t * | env | ||
| ) |
This function allocates and initializes a public logger_t whose backend writes emitted messages to the injected target stream.
Ownership:
*out.logger_destroy().*out is left unchanged.| [out] | out | Receives the created logger handle. Must not be NULL. |
| [in] | cfg | Adapter configuration. Must not be NULL. |
| [in] | env | Adapter environment containing injected dependencies. Must not be NULL. |
| LOGGER_STATUS_OK | Logger successfully created. |
| LOGGER_STATUS_INVALID | One or more arguments are invalid. |
| LOGGER_STATUS_OOM | Memory allocation failed. |
This function allocates the private logger_default backend, initializes it from the injected configuration and environment, and then wires it into the public logger port through logger_create().
| [out] | out | Receives the created logger handle. Must not be NULL. |
| [in] | cfg | Adapter configuration. Must not be NULL. |
| [in] | env | Adapter environment. Must not be NULL. |
| LOGGER_STATUS_OK | Logger successfully created. |
| LOGGER_STATUS_INVALID | One or more public arguments are invalid. |
| LOGGER_STATUS_OOM | Adapter-backend allocation failed. |
Definition at line 314 of file logger_default.c.
| logger_default_cfg_t logger_default_default_cfg | ( | void | ) |
This helper provides a value-initialized baseline configuration that the Composition Root may override.
logger_default_cfg_t.Return a default configuration for the logger_default adapter.
This helper establishes the default runtime behavior of the adapter.
logger_default_cfg_t. Definition at line 43 of file logger_default.c.
| logger_default_env_t logger_default_default_env | ( | stream_t * | stream, |
| const osal_time_ops_t * | time_ops, | ||
| const osal_mem_ops_t * | adapter_mem, | ||
| const logger_env_t * | port_env | ||
| ) |
This helper packages borrowed dependencies into a value-initialized logger_default_env_t.
The returned environment does not take ownership of any pointer passed as argument.
| [in] | stream | Borrowed target stream used by the adapter. |
| [in] | time_ops | Borrowed time operations used for timestamp generation. |
| [in] | adapter_mem | Borrowed memory operations used for adapter-backend allocation. |
| [in] | port_env | Borrowed logger port environment. |
logger_default_env_t aggregating the provided dependencies.This helper packages borrowed runtime dependencies into a logger_default_env_t.
| [in] | stream | Borrowed target stream used by the adapter. |
| [in] | time_ops | Borrowed time operations used for timestamp generation. |
| [in] | adapter_mem | Borrowed memory operations used for adapter-backend allocation. |
| [in] | port_env | Borrowed logger port environment. |
logger_default_env_t aggregating the provided dependencies. Definition at line 70 of file logger_default.c.