diff --git a/Cargo.lock b/Cargo.lock index 1a7c8619..37025c7b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -395,6 +395,7 @@ version = "0.1.0" dependencies = [ "cmd_lib", "fce", + "log", "serde", "serde_derive", "serde_json", diff --git a/fluence-faas/Cargo.toml b/fluence-faas/Cargo.toml index a967ffa0..0cdc6474 100644 --- a/fluence-faas/Cargo.toml +++ b/fluence-faas/Cargo.toml @@ -17,6 +17,7 @@ serde = { version = "1.0.111", features = ["derive"] } serde_json = "1.0.53" serde_derive = "1.0.111" cmd_lib = "0.7.8" +log = "0.4.8" [patch.'https://github.com/fluencelabs/wasmer'] wasmer-wasi = { path = "lib/wasi" } diff --git a/fluence-faas/src/misc/imports.rs b/fluence-faas/src/misc/imports.rs index 8cc8bf05..2e0c94bd 100644 --- a/fluence-faas/src/misc/imports.rs +++ b/fluence-faas/src/misc/imports.rs @@ -32,8 +32,8 @@ pub(super) fn log_utf8_string(ctx: &mut Ctx, offset: i32, size: i32) { let wasm_ptr = WasmPtr::::new(offset as _); match wasm_ptr.get_utf8_string(ctx.memory(0), size as _) { - Some(msg) => print!("{}", msg), - None => println!("ipfs node logger: incorrect UTF8 string's been supplied to logger"), + Some(msg) => log::info!("{}", msg), + None => log::warn!("ipfs node logger: incorrect UTF8 string's been supplied to logger"), } }