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 ab03207 commit acb7be7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nym-node-status-agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[package]
name = "nym-node-status-agent"
version = "0.1.0"
version = "0.1.2"
authors.workspace = true
repository.workspace = true
homepage.workspace = true
Expand Down
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 acb7be7

Please sign in to comment.