wasi-common: switch all logs from log to tracing

tracing is already the dep that wiggle uses.

I used tracing structured arguments wherever I could, but I skipped over
it in all of the snapshot_0 code, because I'm going to delete that code
and replace it with wiggle-based stuff real soon.
This commit is contained in:
Pat Hickey
2020-08-18 10:35:05 -07:00
parent 30b9e69136
commit 94ee96712a
26 changed files with 135 additions and 132 deletions

View File

@@ -96,7 +96,7 @@ fn generate_wrappers(func: &witx::InterfaceFunc, old: bool) -> TokenStream {
let ret = #call
.err()
.unwrap_or(super::wasi::WasiError::ESUCCESS);
log::trace!(" | errno={}", ret);
tracing::trace!(" | errno={}", ret);
ret.as_raw_errno()
}
};

View File

@@ -201,7 +201,7 @@ pub fn define_struct(args: TokenStream) -> TokenStream {
let #name_ident = wasmtime::Func::wrap(
store,
move |caller: wasmtime::Caller<'_> #(,#shim_arg_decls)*| -> #ret_ty {
log::trace!(
tracing::trace!(
#format_str,
#(#format_args),*
);
@@ -209,7 +209,7 @@ pub fn define_struct(args: TokenStream) -> TokenStream {
let memory = match caller.get_export("memory") {
Some(wasmtime::Extern::Memory(m)) => m,
_ => {
log::warn!("callee does not export a memory as \"memory\"");
tracing::warn!("callee does not export a memory as \"memory\"");
let e = wasi_common::old::snapshot_0::wasi::__WASI_ERRNO_INVAL;
#handle_early_error
}