From 46baa42424a3f78175b2ad2d4e3e4ad92fa4b5a1 Mon Sep 17 00:00:00 2001 From: Reactor Scram Date: Wed, 17 Apr 2024 20:04:45 -0500 Subject: [PATCH] chore(linux-client): print resources with `tracing::debug` (#4658) Unfortunately I couldn't make it only happen once. This helps with debugging service accounts, where DNS bugs look the same as forgetting to enable a policy. Closes #4657 --- rust/headless-client/src/linux.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rust/headless-client/src/linux.rs b/rust/headless-client/src/linux.rs index 7bc4e06e3..ca0eb4f1a 100644 --- a/rust/headless-client/src/linux.rs +++ b/rust/headless-client/src/linux.rs @@ -180,6 +180,14 @@ impl Callbacks for CallbackHandler { std::process::exit(1); } + + fn on_update_resources(&self, resources: Vec) { + // See easily with `export RUST_LOG=firezone_headless_client=debug` + tracing::debug!(len = resources.len(), "Printing the resource list one time"); + for resource in &resources { + tracing::debug!(?resource); + } + } } fn get_system_default_resolvers_resolv_conf() -> Result> {