diff --git a/Cargo.lock b/Cargo.lock index 9e19c67c2e..fac8e273c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2156,9 +2156,9 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.16" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e2a2de6b0d5cbb13fc21193a2296888eaab62b6044479aafb3c54c01c29fcd" +checksum = "6d79ca061b032d6ce30c660fded31189ca0b9922bf483cd70759f13a2d86786c" dependencies = [ "cfg-if", "log", @@ -2168,9 +2168,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0693bf8d6f2bf22c690fc61a9d21ac69efdbb894a17ed596b9af0f01e64b84b" +checksum = "1fe233f4227389ab7df5b32649239da7ebe0b281824b4e84b342d04d3fd8c25e" dependencies = [ "proc-macro2", "quote", @@ -2179,9 +2179,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.11" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94ae75f0d28ae10786f3b1895c55fe72e79928fd5ccdebb5438c75e93fec178f" +checksum = "db63662723c316b43ca36d833707cc93dff82a02ba3d7e354f342682cc8b3545" dependencies = [ "lazy_static", ] @@ -2326,6 +2326,7 @@ dependencies = [ "libc", "log", "thiserror", + "tracing", "wig", "wiggle", "winapi", diff --git a/crates/wasi-common/Cargo.toml b/crates/wasi-common/Cargo.toml index c92e98a5e8..f7250c25df 100644 --- a/crates/wasi-common/Cargo.toml +++ b/crates/wasi-common/Cargo.toml @@ -27,6 +27,7 @@ filetime = "0.2.7" lazy_static = "1.4.0" wig = { path = "wig", version = "0.19.0" } wiggle = { path = "../wiggle", default-features = false, version = "0.19.0" } +tracing = "0.1.19" [target.'cfg(unix)'.dependencies] yanix = { path = "yanix", version = "0.19.0" } diff --git a/crates/wasi-common/src/wasi.rs b/crates/wasi-common/src/wasi.rs index f35055ffa8..c632461170 100644 --- a/crates/wasi-common/src/wasi.rs +++ b/crates/wasi-common/src/wasi.rs @@ -2,6 +2,7 @@ //! pointer or `usize`-sized data are excluded here, so this file only contains //! fixed-size types, so it's host/target independent. use crate::WasiCtx; +use tracing::debug; wiggle::from_witx!({ witx: ["WASI/phases/snapshot/witx/wasi_snapshot_preview1.witx"], @@ -19,9 +20,8 @@ impl wiggle::GuestErrorType for Errno { impl types::GuestErrorConversion for WasiCtx { fn into_errno(&self, e: wiggle::GuestError) -> Errno { - eprintln!("Guest error: {:?}", e); - // TODO proper error mapping - Errno::Inval + debug!("Guest error: {:?}", e); + e.into() } }