|
Nexus Embedded Platform 0.1.0
Statically assembled reusable embedded mechanisms
|
Instance-local synchronous bounded log sink. More...
#include "nexus/core/time.h"Go to the source code of this file.
Data Structures | |
| struct | nx_log_sink_port_t |
| Synchronous caller-injected sink. More... | |
| struct | nx_log_t |
| Logger storage belongs to its caller; shared immutable port is copied. More... | |
Enumerations | |
| enum | nx_log_level_t { NX_LOG_DEBUG = 0 , NX_LOG_INFO , NX_LOG_WARNING , NX_LOG_ERROR } |
| Structured severity, with filtering before touching a sink. More... | |
Functions | |
| nx_result_t | nx_log_init (nx_log_t *logger, nx_log_sink_port_t sink, nx_log_level_t minimum) |
| Initialize an unused logger before exposing it to tasks. | |
| nx_result_t | nx_log_write (nx_log_t *logger, nx_log_level_t level, const void *bytes, size_t length, nx_time_us_t deadline) |
| Write caller bytes, with no implicit allocation/formatting. | |
| nx_result_t | nx_log_flush (nx_log_t *logger, nx_time_us_t deadline) |
| Flush an explicit sink without creating a background worker. | |
| nx_result_t | nx_log_stop (nx_log_t *logger) |
| Reject new writes and test whether the sink has exited. | |
Instance-local synchronous bounded log sink.
Definition in file log.h.
| enum nx_log_level_t |
| nx_result_t nx_log_flush | ( | nx_log_t * | logger, |
| nx_time_us_t | deadline ) |
Flush an explicit sink without creating a background worker.
| [in,out] | logger | Live instance |
| [in] | deadline | Absolute sink deadline |
| nx_result_t nx_log_init | ( | nx_log_t * | logger, |
| nx_log_sink_port_t | sink, | ||
| nx_log_level_t | minimum ) |
Initialize an unused logger before exposing it to tasks.
| [out] | logger | Unused caller storage |
| [in] | sink | Required bounded synchronous sink |
| [in] | minimum | Minimum accepted severity |
| nx_result_t nx_log_stop | ( | nx_log_t * | logger | ) |
Reject new writes and test whether the sink has exited.
| [in,out] | logger | Live instance; external users must eventually join |
| nx_result_t nx_log_write | ( | nx_log_t * | logger, |
| nx_log_level_t | level, | ||
| const void * | bytes, | ||
| size_t | length, | ||
| nx_time_us_t | deadline ) |
Write caller bytes, with no implicit allocation/formatting.
| [in,out] | logger | Live instance |
| [in] | level | Message severity |
| [in] | bytes | Message bytes, borrowed only during this call |
| [in] | length | Byte count; zero permits NULL |
| [in] | deadline | Absolute deadline understood by sink |