mirror of
https://github.com/fluencelabs/marine-rs-sdk-test
synced 2024-12-04 15:20:18 +00:00
enable logger if either logger or debug feature is enabled
This commit is contained in:
parent
043af06af6
commit
40774a1107
@ -32,13 +32,13 @@
|
||||
#![warn(rust_2018_idioms)]
|
||||
|
||||
mod export_allocator;
|
||||
#[cfg(feature = "logger")]
|
||||
#[cfg(any(feature = "debug", feature = "logger"))]
|
||||
mod logger;
|
||||
mod result;
|
||||
|
||||
pub use export_allocator::allocate;
|
||||
pub use export_allocator::deallocate;
|
||||
#[cfg(feature = "logger")]
|
||||
#[cfg(any(feature = "debug", feature = "logger"))]
|
||||
pub use logger::WasmLogger;
|
||||
pub use result::get_result_ptr;
|
||||
pub use result::get_result_size;
|
||||
@ -48,7 +48,7 @@ pub use result::set_result_size;
|
||||
#[allow(unused_variables)]
|
||||
pub(crate) fn log<S: AsRef<str>>(msg: S) {
|
||||
// logs will be printed only if debug feature is enabled
|
||||
#[cfg(feature = "debug")]
|
||||
#[cfg(any(feature = "debug", feature = "logger"))]
|
||||
unsafe {
|
||||
let msg = msg.as_ref();
|
||||
logger::log_utf8_string(msg.as_ptr() as _, msg.len() as _);
|
||||
|
@ -35,7 +35,7 @@ extern crate fluence_sdk_macro;
|
||||
extern crate fluence_sdk_main;
|
||||
|
||||
pub use fluence_sdk_macro::fce;
|
||||
#[cfg(feature = "logger")]
|
||||
#[cfg(any(feature = "debug", feature = "logger"))]
|
||||
pub use fluence_sdk_main::WasmLogger;
|
||||
|
||||
/// These API functions are intended for internal usage in generated code.
|
||||
|
Loading…
Reference in New Issue
Block a user