Logging Service

group Logging Service

Structured logging for EPS subsystems.

group Component IDs

Component identifiers for log filtering and organization.

Defines

EPS_COMPONENT_MAIN

Main application

EPS_COMPONENT_RAIL

Rail controller

EPS_COMPONENT_MPPT

MPPT controller

EPS_COMPONENT_POWER

Power policies

EPS_COMPONENT_CMD

Command handler

EPS_COMPONENT_COMMS

Communications

EPS_COMPONENT_ADC

ADC/sensing

EPS_COMPONENT_PROFILE

Power profiles

group Public API

External interface for the logging service.

Functions

void logging_init(osusat_slog_level_t min_level, uart_events_t *primary_uart, uart_events_t *aux_uart)

Initialize the logging service.

Must be called after hal_uart_init() and before any logging.

Parameters:

min_level[in] Minimum log level to record.

size_t logging_flush(void)

Flush pending logs to OBC via UART.

Should be called periodically from main loop or triggered by events.

Returns:

Number of log entries flushed.

void logging_set_level(osusat_slog_level_t level)

Change the minimum log level at runtime.

Useful for debugging, can be called via command handler.

Parameters:

level[in] New minimum log level.

size_t logging_pending_count(void)

Get number of pending log entries.

Returns:

Approximate count of buffered logs.