diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 1739abe..30475ae 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -26,7 +26,6 @@ pub(crate) mod common_generated { } pub mod client_api; -#[cfg(feature = "contract")] pub mod log; #[cfg(feature = "contract")] pub mod rand; diff --git a/rust/src/log.rs b/rust/src/log.rs index 8fc87d4..752e626 100644 --- a/rust/src/log.rs +++ b/rust/src/log.rs @@ -1,3 +1,13 @@ +#[macro_export] +macro_rules! info { + ($($arg:tt)*) => { + #[cfg(not(feature = "contract"))] + tracing::info!($($arg)*); + #[cfg(feature = "contract")] + ::freenet_stdlib::log::info(&format!($($arg)*)); + }; +} + pub fn info(msg: &str) { let ptr = msg.as_ptr() as _; unsafe {