mirror of
https://github.com/fluencelabs/wasmer
synced 2025-05-21 06:31:20 +00:00
Merge pull request #129 from wasmerio/fix/update-debug-macro
Consolidate to single debug macro, activate using feature
This commit is contained in:
commit
c5dea064c9
@ -1,4 +1 @@
|
||||
macro_rules! debug {
|
||||
($fmt:expr) => (if cfg!(any(debug_assertions, feature="debug")) { println!(concat!("wasmer-runtime(:{})::", $fmt), line!()) });
|
||||
($fmt:expr, $($arg:tt)*) => (if cfg!(any(debug_assertions, feature="debug")) { println!(concat!("wasmer-runtime(:{})::", $fmt, "\n"), line!(), $($arg)*) });
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,15 @@
|
||||
#![allow(unused)]
|
||||
|
||||
#[macro_export]
|
||||
#[cfg(feature = "debug")]
|
||||
macro_rules! debug {
|
||||
($fmt:expr) => (if cfg!(any(debug_assertions, feature="debug")) { println!(concat!("wasmer-runtime(:{})::", $fmt), line!()) });
|
||||
($fmt:expr, $($arg:tt)*) => (if cfg!(any(debug_assertions, feature="debug")) { println!(concat!("wasmer-runtime(:{})::", $fmt, "\n"), line!(), $($arg)*) });
|
||||
($fmt:expr) => (println!(concat!("wasmer-runtime(:{})::", $fmt), line!()));
|
||||
($fmt:expr, $($arg:tt)*) => (println!(concat!("wasmer-runtime(:{})::", $fmt, "\n"), line!(), $($arg)*));
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
#[cfg(not(feature = "debug"))]
|
||||
macro_rules! debug {
|
||||
($fmt:expr) => {};
|
||||
($fmt:expr, $($arg:tt)*) => {};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
|
@ -1,8 +1,7 @@
|
||||
#[macro_use]
|
||||
extern crate wasmer_runtime_core;
|
||||
// extern crate wasmer_emscripten;
|
||||
|
||||
#[macro_use]
|
||||
mod macros;
|
||||
#[macro_use]
|
||||
pub mod update;
|
||||
pub mod webassembly;
|
||||
|
@ -1,5 +0,0 @@
|
||||
#[macro_export]
|
||||
macro_rules! debug {
|
||||
($fmt:expr) => (if cfg!(any(debug_assertions, feature="debug")) { println!(concat!("Wasmer::", $fmt)) });
|
||||
($fmt:expr, $($arg:tt)*) => (if cfg!(any(debug_assertions, feature="debug")) { println!(concat!("Wasmer::", $fmt, "\n"), $($arg)*) });
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user