File SolidSyslog.h¶
FileList > Core > Interface > SolidSyslog.h
Go to the source code of this file
The application logging API: SolidSyslog_Log / _LogWithSd to emit an event, SolidSyslog_Service to drive delivery, and the SolidSyslogMessage struct.
#include "ExternC.h"#include "SolidSyslogPrival.h"#include "SolidSyslogServiceStatus.h"#include <stddef.h>
Classes¶
| Type | Name |
|---|---|
| struct | SolidSyslogMessage One event to log. |
Public Functions¶
| Type | Name |
|---|---|
| void | SolidSyslog_Log (struct SolidSyslog * handle, const struct SolidSyslogMessage * message) Format message and hand it to the configured Buffer. |
| void | SolidSyslog_LogWithSd (struct SolidSyslog * handle, const struct SolidSyslogMessage * message, struct SolidSyslogStructuredData ** sd, size_t sdCount) As SolidSyslog_Log, but also attaches sd [0..sdCount) as caller-built SD-ELEMENTs to this one message, emitted after the per-instance SDs registered at Create. |
| enum SolidSyslogServiceStatus | SolidSyslog_Service (struct SolidSyslog * handle) Run one servicing pass (drain the buffer into the store, then attempt one send from the store) and return an advisory hint for driving an event-driven loop. |
Public Functions Documentation¶
function SolidSyslog_Log¶
Format message and hand it to the configured Buffer.
Whether this blocks depends on that Buffer: a PassthroughBuffer sends inline; a CircularBuffer enqueues and returns, leaving delivery to SolidSyslog_Service. Concurrent calls are safe only if the configured Buffer is thread-safe (e.g. a CircularBuffer with a real Mutex). A NULL handle or message is reported via SolidSyslog_Error and otherwise ignored.
function SolidSyslog_LogWithSd¶
As SolidSyslog_Log, but also attaches sd [0..sdCount) as caller-built SD-ELEMENTs to this one message, emitted after the per-instance SDs registered at Create.
void SolidSyslog_LogWithSd (
struct SolidSyslog * handle,
const struct SolidSyslogMessage * message,
struct SolidSyslogStructuredData ** sd,
size_t sdCount
)
The SD objects need only live for the duration of the call. (SolidSyslog_Log is this with sd = NULL, sdCount = 0.)
function SolidSyslog_Service¶
Run one servicing pass (drain the buffer into the store, then attempt one send from the store) and return an advisory hint for driving an event-driven loop.
The hint is never load-bearing: each call re-derives its state from the live buffer and store, so a missed or spurious wake is safe and a fixed-delay poll loop may ignore the return. A NULL handle is reported and returns IDLE.
Return value:
SOLIDSYSLOG_SERVICE_IDLENothing to do anywhere; wait for the next Log.SOLIDSYSLOG_SERVICE_READYWork moved this pass, or the store still has unsent after a send; loop again.SOLIDSYSLOG_SERVICE_BLOCKEDThe buffer was idle and only the sender is stuck (a send was attempted and failed); back off, a Log will wake it.SOLIDSYSLOG_SERVICE_HALTEDThe store is halted (only under SolidSyslogDiscardPolicy_Halt); alarm / slow heartbeat.
Buffer drain out-ranks a send failure: a down sender never demotes the loop out of "keep draining" while the buffer still has records to move.
The documentation for this class was generated from the following file Core/Interface/SolidSyslog.h