|
SafeAPI RBC 2oo2 Generic Application
IL/CTC route and train logic for the safeAPIRBC2oo2 reference RBC
|
See gateway_c_logctl.h. More...
#include "gateway_c_logctl.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include "safeapi/oal/log/sapi_log.h"#include "common/rbc_wire_types.h"#include "common/site_config.h"#include "gateway_c_il_handler.h"Go to the source code of this file.
Macros | |
| #define | GATEWAY_C_LOGCTL_LINE_MAX 16U |
Functions | |
| static bool | gateway_c_logctl_read_level (const char *path, sapi_log_level_t *out_level) |
| 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. | |
Variables | |
| static int | s_applied_level = -1 |
See gateway_c_logctl.h.
Definition in file gateway_c_logctl.c.
| #define GATEWAY_C_LOGCTL_LINE_MAX 16U |
Local makros Longest level spelling ("WARNING") + a bit of slack for a trailing newline / stray whitespace on the file's first line.
Definition at line 20 of file gateway_c_logctl.c.
| 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.
Global functions
| ctx | Gateway context (for the site name in log lines). Must not be NULL. |
Definition at line 33 of file gateway_c_logctl.c.
|
static |
Local function declarations
Definition at line 68 of file gateway_c_logctl.c.
|
static |
Local variables declarations Last level actually applied by this module, so an unchanged file is a no-op. Starts at an out-of-range sentinel so the first valid read always "changes".
Definition at line 26 of file gateway_c_logctl.c.