SafeAPI RBC 2oo2 Generic Application
IL/CTC route and train logic for the safeAPIRBC2oo2 reference RBC
Loading...
Searching...
No Matches
gateway_c_logctl.h File Reference

Role C's runtime log-level control "service": one place from which the whole RBC (A, B and C) can be re-levelled. More...

#include "gateway_c_types.h"
Include dependency graph for gateway_c_logctl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void gateway_c_logctl_poll (gateway_c_context_t *ctx)
 Called once per C cycle (gateway_c_execute()). If SAPI_RBC_LOG_LEVEL_FILE is set and its first line now names a different valid level than last applied, apply it to this process (sapi_log_set_level()) and broadcast a RBC_MSG_SET_LOG_LEVEL frame to A and B (gateway_c_il_handler_broadcast_to_ab()). No-op otherwise - including when the env var is unset, the file is missing, or the content is unchanged/invalid.

Detailed Description

Role C's runtime log-level control "service": one place from which the whole RBC (A, B and C) can be re-levelled.

Purely diagnostic - sapi_log is explicitly non-safety (ADR-001 section 4). Never on a safety path: this only ever calls sapi_log_set_level() and broadcasts one RBC_MSG_SET_LOG_LEVEL control frame; it cannot influence any RBC decision.

Input is a small text file whose path comes from the environment variable SAPI_RBC_LOG_LEVEL_FILE (unset -> the feature is inert). Its first line is one of "DEBUG"/"INFO"/"WARNING"/"ERROR" (as sapi_log_level_to_string() spells them). A plain file rather than a socket so it needs no new listener on this SIL-oriented process and works identically for a local run (write the file) and a container run (mount it); role C is already the process that reads text config files (gateway_c_config.c).

Definition in file gateway_c_logctl.h.

Function Documentation

◆ gateway_c_logctl_poll()

void gateway_c_logctl_poll ( gateway_c_context_t * ctx)

Called once per C cycle (gateway_c_execute()). If SAPI_RBC_LOG_LEVEL_FILE is set and its first line now names a different valid level than last applied, apply it to this process (sapi_log_set_level()) and broadcast a RBC_MSG_SET_LOG_LEVEL frame to A and B (gateway_c_il_handler_broadcast_to_ab()). No-op otherwise - including when the env var is unset, the file is missing, or the content is unchanged/invalid.

Parameters
ctxGateway context (for the site name in log lines). Must not be NULL.

Global functions

Definition at line 33 of file gateway_c_logctl.c.