From c689f8e78aeef7a288f1f0c87c62849bcb76754f Mon Sep 17 00:00:00 2001 From: Karolin Varner Date: Sat, 2 Aug 2025 16:52:06 +0200 Subject: [PATCH] feat(rp): Enable logging --- Cargo.lock | 2 ++ rp/Cargo.toml | 2 ++ rp/src/main.rs | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 8e15916..1993211 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2228,10 +2228,12 @@ dependencies = [ "anyhow", "base64ct", "ctrlc-async", + "env_logger", "futures", "futures-util", "genetlink", "libc", + "log", "netlink-packet-core", "netlink-packet-generic", "netlink-packet-wireguard", diff --git a/rp/Cargo.toml b/rp/Cargo.toml index 77b79b9..a0d6695 100644 --- a/rp/Cargo.toml +++ b/rp/Cargo.toml @@ -18,6 +18,8 @@ toml = { workspace = true } x25519-dalek = { workspace = true, features = ["static_secrets"] } zeroize = { workspace = true } libc = { workspace = true } +log = { workspace = true } +env_logger = { workspace = true } rosenpass = { workspace = true } rosenpass-ciphers = { workspace = true } diff --git a/rp/src/main.rs b/rp/src/main.rs index d9034ff..249793a 100644 --- a/rp/src/main.rs +++ b/rp/src/main.rs @@ -24,6 +24,10 @@ async fn main() -> anyhow::Result<()> { } }; + // init logging + // TODO: Taken from rosenpass; we should deduplicate the code. + env_logger::Builder::from_default_env().init(); // sets log level filter from environment (or defaults) + let command = cli.command.unwrap(); match command {