mirror of
https://github.com/fluencelabs/wasmer
synced 2025-04-25 10:22:19 +00:00
add trace macro for more verbose debug statements
This commit is contained in:
parent
245cc32937
commit
a9f643f774
@ -44,6 +44,7 @@ rustc_version = "0.2.3"
|
||||
[features]
|
||||
default = ["fast-tests", "wasi"]
|
||||
debug = ["wasmer-runtime-core/debug"]
|
||||
trace = ["wasmer-runtime-core/trace"]
|
||||
extra-debug = ["wasmer-clif-backend/debug", "wasmer-runtime-core/debug"]
|
||||
# This feature will allow cargo test to run much faster
|
||||
fast-tests = []
|
||||
|
@ -50,3 +50,4 @@ rustc_version = "0.2.3"
|
||||
|
||||
[features]
|
||||
debug = []
|
||||
trace = ["debug"]
|
||||
|
@ -18,6 +18,24 @@ macro_rules! debug {
|
||||
($fmt:expr, $($arg:tt)*) => {};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
#[cfg(feature = "trace")]
|
||||
macro_rules! trace {
|
||||
($fmt:expr) => {
|
||||
debug!($fmt)
|
||||
};
|
||||
($fmt:expr, $($arg:tt)*) => {
|
||||
debug!($fmt, $($arg)*);
|
||||
}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
#[cfg(not(feature = "trace"))]
|
||||
macro_rules! trace {
|
||||
($fmt:expr) => {};
|
||||
($fmt:expr, $($arg:tt)*) => {};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! func {
|
||||
($func:path) => {{
|
||||
|
@ -3,11 +3,11 @@ macro_rules! wasi_try {
|
||||
let res: Result<_, crate::syscalls::types::__wasi_errno_t> = $expr;
|
||||
match res {
|
||||
Ok(val) => {
|
||||
debug!("wasi::wasi_try::val: {:?}", val);
|
||||
wasmer_runtime_core::trace!("wasi::wasi_try::val: {:?}", val);
|
||||
val
|
||||
}
|
||||
Err(err) => {
|
||||
debug!("wasi::wasi_try::err: {:?}", err);
|
||||
wasmer_runtime_core::trace!("wasi::wasi_try::err: {:?}", err);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user