enable logger if either logger or debug feature is enabled

This commit is contained in:
vms 2020-07-14 00:50:13 +03:00
parent 043af06af6
commit 40774a1107
2 changed files with 4 additions and 4 deletions

View File

@ -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 _);

View File

@ -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.