Skip to content

Commit

Permalink
Better logging on agent
Browse files Browse the repository at this point in the history
  • Loading branch information
dynco-nym committed Oct 30, 2024
1 parent e918901 commit d45ef90
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions nym-node-status-agent/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions nym-node-status-agent/src/probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit d45ef90

Please sign in to comment.