mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-12 05:18:43 +00:00
Improvements to the tracing and logging in wasmer
- Now using the fmt subscriber for improved formatting - Using spans on all syscalls - Added recorded fields on the spans instead trace and debug macros - Adding timing on all syscall
This commit is contained in:
committed by
Christoph Herzog
parent
6d33d57e6e
commit
6dde2831a0
@@ -1,4 +1,4 @@
|
||||
use std::{any::Any, marker::PhantomData};
|
||||
use std::{any::Any, fmt::Debug, marker::PhantomData};
|
||||
|
||||
use crate::vm::VMFunctionEnvironment;
|
||||
|
||||
@@ -102,6 +102,12 @@ pub struct FunctionEnvMut<'a, T: 'a> {
|
||||
pub(crate) func_env: FunctionEnv<T>,
|
||||
}
|
||||
|
||||
impl<'a, T> Debug for FunctionEnvMut<'a, T> {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "env_mut")
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Send + 'static> FunctionEnvMut<'_, T> {
|
||||
/// Returns a reference to the host state in this function environement.
|
||||
pub fn data(&self) -> &T {
|
||||
|
||||
@@ -278,11 +278,6 @@ impl<T: ValueType, M: MemorySize> Eq for WasmPtr<T, M> {}
|
||||
|
||||
impl<T: ValueType, M: MemorySize> fmt::Debug for WasmPtr<T, M> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(
|
||||
f,
|
||||
"WasmPtr(offset: {}, pointer: {:#x})",
|
||||
self.offset.into(),
|
||||
self.offset.into()
|
||||
)
|
||||
write!(f, "{}(@{})", std::any::type_name::<T>(), self.offset.into())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user