diff --git a/cmd/crates/soroban-test/tests/it/integration/hello_world.rs b/cmd/crates/soroban-test/tests/it/integration/hello_world.rs index 20b680997..e523efb8f 100644 --- a/cmd/crates/soroban-test/tests/it/integration/hello_world.rs +++ b/cmd/crates/soroban-test/tests/it/integration/hello_world.rs @@ -394,12 +394,12 @@ fn invoke_log(sandbox: &TestEnv, id: &str) { .assert() .success() .stderr(predicates::str::contains( - "INFO contract_event: soroban_cli::log::event: 1: DiagnosticEvent {", + "INFO contract_event: soroban_cli::log::event: 1:", )) - .stderr(predicates::str::contains("StringM(hello)")) + .stderr(predicates::str::contains("hello")) .stderr(predicates::str::contains( - "INFO log_event: soroban_cli::log::event: 2: DiagnosticEvent", + "INFO log_event: soroban_cli::log::event: 2:", )) - .stderr(predicates::str::contains("StringM(hello {})")) - .stderr(predicates::str::contains("StringM(world)")); + .stderr(predicates::str::contains("hello {}")) + .stderr(predicates::str::contains("world")); } diff --git a/cmd/soroban-cli/src/log/event.rs b/cmd/soroban-cli/src/log/event.rs index 8a4fedfbf..4ff7debb9 100644 --- a/cmd/soroban-cli/src/log/event.rs +++ b/cmd/soroban-cli/src/log/event.rs @@ -1,6 +1,7 @@ use tracing::{debug, info, span, Level}; use crate::xdr; +use xdr::WriteXdr; pub fn events(events: &[xdr::DiagnosticEvent]) { for (i, event) in events.iter().enumerate() { @@ -14,10 +15,12 @@ pub fn events(events: &[xdr::DiagnosticEvent]) { let _enter = span.enter(); + let xdr = event.to_xdr_base64(xdr::Limits::none()).unwrap(); + let json = serde_json::to_string(event).unwrap(); if span.metadata().unwrap().level() == &Level::INFO { - info!("{i}: {event:#?}"); + info!("{i}: {xdr} {json}"); } else { - debug!("{i}: {event:#?}"); + debug!("{i}: {xdr} {json}"); } } }