From d45ef90ade03b951e95beaff37f195b69952821c Mon Sep 17 00:00:00 2001 From: dynco-nym <173912580+dynco-nym@users.noreply.github.com> Date: Wed, 30 Oct 2024 01:09:01 +0100 Subject: [PATCH] Better logging on agent --- nym-node-status-agent/src/cli.rs | 1 + nym-node-status-agent/src/probe.rs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/nym-node-status-agent/src/cli.rs b/nym-node-status-agent/src/cli.rs index c4465797d0..d81f18b39c 100644 --- a/nym-node-status-agent/src/cli.rs +++ b/nym-node-status-agent/src/cli.rs @@ -97,6 +97,7 @@ async fn submit_results( ) -> anyhow::Result<()> { let target_url = format!("{}/{}/{}", server_addr, URL_BASE, testrun_id); let client = reqwest::Client::new(); + let res = client .post(target_url) .body(probe_outcome) diff --git a/nym-node-status-agent/src/probe.rs b/nym-node-status-agent/src/probe.rs index c75900e936..f779f3af53 100644 --- a/nym-node-status-agent/src/probe.rs +++ b/nym-node-status-agent/src/probe.rs @@ -40,6 +40,12 @@ impl GwProbe { match command.spawn() { Ok(child) => { if let Ok(output) = child.wait_with_output() { + if !output.status.success() { + let out = String::from_utf8_lossy(&output.stdout); + let err = String::from_utf8_lossy(&output.stderr); + tracing::error!("Probe exited with {:?}:\n{}\n{}", output.status, out, err); + } + return String::from_utf8(output.stdout) .unwrap_or("Unable to get log from test run".to_string()); }