Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
Logging Module - User Guide

What is Logging?

Logging provides bounded ring-buffer logging for diagnostics. All entries go to fixed buffer; oldest entries overwritten when full.

Log Levels

DEBUG - Development diagnostics (disabled in production) INFO - Informational events WARNING - Potential issues, continuing ERROR - Failures, recovery attempted CRITICAL - Imminent shutdown

Quick Start

rte_log_debug("value=%d", x);
rte_log_info("System initialized");
rte_log_warning("Low battery");
rte_log_error("Read failed: %s", reason);
rte_log_critical("Entering safe-state");

Best Practices

  1. Use appropriate level
  2. Include context (what, why, state)
  3. Never log secrets (passwords, keys)
  4. Flush before shutdown/reboot

See Also