diff --git a/rust/ffi/node/Cargo.toml b/rust/ffi/node/Cargo.toml index 6b281c0b..f49a6da4 100644 --- a/rust/ffi/node/Cargo.toml +++ b/rust/ffi/node/Cargo.toml @@ -21,3 +21,4 @@ tokio = { version = "1.23", features = ["rt-multi-thread"] } neon = {version = "0.10.1", default-features = false, features = ["channel-api", "napi-6", "promise-api", "task-api"] } object_store = { workspace = true, features = ["aws"] } async-trait = "0" +env_logger = "0" diff --git a/rust/ffi/node/src/lib.rs b/rust/ffi/node/src/lib.rs index 232cbaa3..7fe18e4b 100644 --- a/rust/ffi/node/src/lib.rs +++ b/rust/ffi/node/src/lib.rs @@ -82,6 +82,9 @@ where fn runtime<'a, C: Context<'a>>(cx: &mut C) -> NeonResult<&'static Runtime> { static RUNTIME: OnceCell = OnceCell::new(); + static LOG: OnceCell<()> = OnceCell::new(); + + LOG.get_or_init(|| env_logger::init()); RUNTIME.get_or_try_init(|| Runtime::new().or_else(|err| cx.throw_error(err.to_string()))) }