better wrapping

This commit is contained in:
vms 2020-10-06 12:03:32 +03:00
parent 39b7641373
commit 742ff0e2df
2 changed files with 7 additions and 2 deletions

View File

@ -55,6 +55,11 @@ pub(crate) fn log<S: AsRef<str>>(msg: S) {
#[cfg(feature = "debug")]
unsafe {
let msg = msg.as_ref();
logger::log_utf8_string(msg.as_ptr() as _, msg.len() as _);
if cfg!(target_arch = "wasm32") {
unsafe { logger::log_utf8_string(log_msg.as_ptr() as i32, log_msg.len() as i32) };
} else {
println!("{}", log_msg);
}
}
}

View File

@ -144,7 +144,7 @@ impl log::Log for WasmLogger {
record.args()
);
// this allows compiling sdk on x86_64
// this allows building sdk for x86_64
if cfg!(target_arch = "wasm32") {
unsafe { log_utf8_string(log_msg.as_ptr() as i32, log_msg.len() as i32) };
} else {