Establish config loading and logging infrastructure

First working milestone of the Rust rewrite. Implements the two
foundational systems every other component depends on:

- TOML-based layered config (beds.toml + env.toml override) replacing
  the PHP XML config system, fully deserialized into typed structs via
  serde — no runtime string key lookups, shape enforced at compile time
- Structured logging via tracing + tracing-journald, with optional
  console mirror, initialized from config before any services start

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-30 12:33:52 -07:00
parent bb6df8314c
commit 22c74b2671
8 changed files with 934 additions and 1 deletions

View File

@@ -1,3 +1,10 @@
mod config;
mod logging;
fn main() {
println!("Hello, world!");
let cfg = config::load().expect("Failed to load config");
logging::init_from_config(cfg.syslog, cfg.syslog_mirror_console);
tracing::info!("BEDS starting, env={}", cfg.id.env_name);
tracing::info!("Logging initialized");
}