Skip to content

Commit

Permalink
Support debug logs (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch authored Sep 22, 2022
1 parent 722d8d8 commit 80dfc96
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

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

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ edition = "2021"
rust-version = "1.63"

[dependencies]
soroban-env-host = { version = "0.0.5", features = ["vm", "serde"] }
soroban-env-host = { version = "0.0.5", features = ["vm", "serde", "hostfn_log_fmt_values"] }
soroban-spec = "0.0.4"
stellar-strkey = "0.0.2"
clap = { version = "3.1.18", features = ["derive", "env"] }
Expand All @@ -31,11 +31,11 @@ wasmparser = "0.90.0"
sha2 = "0.10.2"

[patch.crates-io]
soroban-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "cdcd5185" }
soroban-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "49feecab" }
stellar-strkey = { git = "https://github.com/stellar/rs-stellar-strkey", rev = "dc234c4" }
soroban-env-common = { git = "https://github.com/stellar/rs-soroban-env", rev = "fccd5196" }
soroban-env-host = { git = "https://github.com/stellar/rs-soroban-env", rev = "fccd5196" }
soroban-env-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "fccd5196" }
soroban-native-sdk-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "fccd5196" }
soroban-env-common = { git = "https://github.com/stellar/rs-soroban-env", rev = "38ed32b4" }
soroban-env-host = { git = "https://github.com/stellar/rs-soroban-env", rev = "38ed32b4" }
soroban-env-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "38ed32b4" }
soroban-native-sdk-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "38ed32b4" }
stellar-xdr = { git = "https://github.com/stellar/rs-stellar-xdr", rev = "c026149" }
wasmi = { package = "soroban-wasmi", git = "https://github.com/stellar/wasmi", rev = "a61b6df" }
8 changes: 5 additions & 3 deletions src/invoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,12 @@ impl Cmd {
}

for (i, event) in events.0.iter().enumerate() {
eprint!("Event #{}: ", i);
eprint!("#{}: ", i);
match event {
HostEvent::Contract(e) => eprintln!("{}", serde_json::to_string(&e).unwrap()),
HostEvent::Debug(e) => eprintln!("{}", e),
HostEvent::Contract(e) => {
eprintln!("event: {}", serde_json::to_string(&e).unwrap());
}
HostEvent::Debug(e) => eprintln!("debug: {}", e),
}
}

Expand Down

0 comments on commit 80dfc96

Please sign in to comment.