File syn_errlog.c¶
FileList > src > syntropic > system > syn_errlog.c
Go to the source code of this file
Persistent error registry implementation.
#include "../port/syn_port_system.h"#include "../util/syn_assert.h"#include "syn_errlog.h"#include <string.h>
Public Functions¶
| Type | Name |
|---|---|
| void | syn_errlog_clear (SYN_ErrLog * log) Clear all entries. |
| size_t | syn_errlog_count_severity (const SYN_ErrLog * log, SYN_ErrSeverity severity) Count errors with a specific severity level. |
| void | syn_errlog_init (SYN_ErrLog * log, SYN_ErrEntry * entries, size_t capacity, uint32_t boot_count) Initialize the error log. |
| const SYN_ErrEntry * | syn_errlog_latest (const SYN_ErrLog * log) Get the most recent error entry. |
| bool | syn_errlog_read (const SYN_ErrLog * log, size_t index, SYN_ErrEntry * out) Read an error entry by index (0 = oldest available). |
| void | syn_errlog_record (SYN_ErrLog * log, uint16_t code, SYN_ErrSeverity severity, uint32_t context) Record an error. |
Public Functions Documentation¶
function syn_errlog_clear¶
Clear all entries.
Parameters:
logError log.
function syn_errlog_count_severity¶
Count errors with a specific severity level.
Parameters:
logError log.severitySeverity to count.
Returns:
Number of matching entries.
function syn_errlog_init¶
Initialize the error log.
void syn_errlog_init (
SYN_ErrLog * log,
SYN_ErrEntry * entries,
size_t capacity,
uint32_t boot_count
)
Parameters:
logError log instance.entriesCaller-provided entry buffer.capacityNumber of entries in buffer.boot_countCurrent boot count (from boot manager or 0).
function syn_errlog_latest¶
Get the most recent error entry.
Parameters:
logError log.
Returns:
Pointer to latest entry, or NULL if empty.
function syn_errlog_read¶
Read an error entry by index (0 = oldest available).
Parameters:
logError log.indexEntry index.outOutput entry.
Returns:
true if entry exists.
function syn_errlog_record¶
Record an error.
void syn_errlog_record (
SYN_ErrLog * log,
uint16_t code,
SYN_ErrSeverity severity,
uint32_t context
)
Parameters:
logError log.codeApplication-defined error code.severitySeverity level.contextApplication-defined context value.
The documentation for this class was generated from the following file src/syntropic/system/syn_errlog.c