mirror of
https://github.com/fluencelabs/marine-rs-sdk
synced 2025-03-15 14:30:48 +00:00
better wrapping
This commit is contained in:
parent
39b7641373
commit
742ff0e2df
@ -55,6 +55,11 @@ pub(crate) fn log<S: AsRef<str>>(msg: S) {
|
|||||||
#[cfg(feature = "debug")]
|
#[cfg(feature = "debug")]
|
||||||
unsafe {
|
unsafe {
|
||||||
let msg = msg.as_ref();
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,7 @@ impl log::Log for WasmLogger {
|
|||||||
record.args()
|
record.args()
|
||||||
);
|
);
|
||||||
|
|
||||||
// this allows compiling sdk on x86_64
|
// this allows building sdk for x86_64
|
||||||
if cfg!(target_arch = "wasm32") {
|
if cfg!(target_arch = "wasm32") {
|
||||||
unsafe { log_utf8_string(log_msg.as_ptr() as i32, log_msg.len() as i32) };
|
unsafe { log_utf8_string(log_msg.as_ptr() as i32, log_msg.len() as i32) };
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user