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

@@ -359,7 +359,10 @@ impl WasiCtxBuilder {
self.stdout.take().unwrap(),
self.stderr.take().unwrap(),
] {
log::debug!("WasiCtx inserting entry {:?}", pending);
tracing::debug!(
pending = tracing::field::debug(&pending),
"WasiCtx inserting entry"
);
let fd = match pending {
PendingEntry::Thunk(f) => {
let handle = EntryHandle::from(f()?);
@@ -376,7 +379,7 @@ impl WasiCtxBuilder {
.ok_or(WasiCtxBuilderError::TooManyFilesOpen)?
}
};
log::debug!("WasiCtx inserted at {:?}", fd);
tracing::debug!(fd = tracing::field::debug(fd), "WasiCtx inserted");
}
// Then add the preopen entries.
for (guest_path, preopen) in self.preopens.take().unwrap() {
@@ -386,7 +389,7 @@ impl WasiCtxBuilder {
let fd = entries
.insert(entry)
.ok_or(WasiCtxBuilderError::TooManyFilesOpen)?;
log::debug!("WasiCtx inserted at {:?}", fd);
tracing::debug!(fd = tracing::field::debug(fd), "WasiCtx inserted",);
}
Ok(WasiCtx {