Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Inline WASM logging into the shared binding library

Manav Rathi3b535fe161ec
diff --git a/rust/Cargo.lock b/rust/Cargo.lock
index 2c53fd76f7..40836b1c7d 100644
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -2421,7 +2421,7 @@ version = "0.0.0"
dependencies = [
"ente-cast",
"ente-core",
- "ente-wasm-log",
+ "ente-wasm-lib",
"js-sys",
"thiserror 2.0.18",
"wasm-bindgen",
@@ -2535,7 +2535,7 @@ version = "0.0.0"
dependencies = [
"ente-core",
"ente-ensu-crypto",
- "ente-wasm-log",
+ "ente-wasm-lib",
"js-sys",
"thiserror 2.0.18",
"wasm-bindgen",
@@ -2594,7 +2594,6 @@ dependencies = [
"ente-core",
"ente-legacy",
"ente-wasm-lib",
- "ente-wasm-log",
"js-sys",
"serde",
"serde-wasm-bindgen",
@@ -2645,7 +2644,6 @@ name = "ente-locker-wasm"
version = "0.0.0"
dependencies = [
"ente-wasm-lib",
- "ente-wasm-log",
]
[[package]]
@@ -2698,7 +2696,7 @@ version = "0.0.0"
dependencies = [
"ente-core",
"ente-paste",
- "ente-wasm-log",
+ "ente-wasm-lib",
"js-sys",
"thiserror 2.0.18",
"wasm-bindgen",
@@ -2749,7 +2747,6 @@ name = "ente-photos-wasm"
version = "0.0.0"
dependencies = [
"ente-wasm-lib",
- "ente-wasm-log",
]
[[package]]
@@ -2757,7 +2754,6 @@ name = "ente-prelogin-wasm"
version = "0.0.0"
dependencies = [
"ente-wasm-lib",
- "ente-wasm-log",
]
[[package]]
@@ -2819,7 +2815,7 @@ version = "0.0.0"
dependencies = [
"ente-core",
"ente-space",
- "ente-wasm-log",
+ "ente-wasm-lib",
"js-sys",
"log",
"serde",
@@ -2855,6 +2851,7 @@ dependencies = [
"ente-contacts",
"ente-core",
"js-sys",
+ "log",
"md-5 0.11.0",
"serde",
"serde-wasm-bindgen",
@@ -2862,15 +2859,6 @@ dependencies = [
"tsify",
"wasm-bindgen",
"wasm-bindgen-futures",
-]
-
-[[package]]
-name = "ente-wasm-log"
-version = "0.0.0"
-dependencies = [
- "js-sys",
- "log",
- "wasm-bindgen",
"web-sys",
]
diff --git a/rust/Cargo.toml b/rust/Cargo.toml
index 0a3c11d8f9..7a9d5d6ae9 100644
--- a/rust/Cargo.toml
+++ b/rust/Cargo.toml
@@ -17,7 +17,6 @@ members = [
"bindings/wasm/legacy",
"bindings/wasm/lib",
"bindings/wasm/locker",
- "bindings/wasm/log",
"bindings/wasm/paste",
"bindings/wasm/photos",
"bindings/wasm/prelogin",
@@ -61,7 +60,6 @@ ente-space = { path = "crates/space" }
ente-test-support = { path = "crates/test-support" }
ente-uniffi-log = { path = "bindings/uniffi/log" }
ente-wasm-lib = { path = "bindings/wasm/lib" }
-ente-wasm-log = { path = "bindings/wasm/log" }
fast_image_resize = { version = "5.5.0", features = ["image"] }
flate2 = "1.1.9"
flutter_rust_bridge = "=2.12.0"
diff --git a/rust/bindings/wasm/cast/Cargo.toml b/rust/bindings/wasm/cast/Cargo.toml
index 28fffb4e33..2fab2fb806 100644
--- a/rust/bindings/wasm/cast/Cargo.toml
+++ b/rust/bindings/wasm/cast/Cargo.toml
@@ -8,7 +8,7 @@ crate-type = ["cdylib"]
[dependencies]
ente-cast.workspace = true
ente-core.workspace = true
-ente-wasm-log.workspace = true
+ente-wasm-lib.workspace = true
js-sys.workspace = true
thiserror.workspace = true
wasm-bindgen.workspace = true
diff --git a/rust/bindings/wasm/cast/src/lib.rs b/rust/bindings/wasm/cast/src/lib.rs
index ba05541c6d..ffd8e6ff79 100644
--- a/rust/bindings/wasm/cast/src/lib.rs
+++ b/rust/bindings/wasm/cast/src/lib.rs
@@ -1,8 +1,7 @@
use ente_cast::ReceiverCredentials;
+use ente_wasm_lib as _;
use wasm_bindgen::prelude::*;
-use ente_wasm_log as _;
-
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error(transparent)]
diff --git a/rust/bindings/wasm/ensu/Cargo.toml b/rust/bindings/wasm/ensu/Cargo.toml
index d5fbbb14c7..52d9790ec0 100644
--- a/rust/bindings/wasm/ensu/Cargo.toml
+++ b/rust/bindings/wasm/ensu/Cargo.toml
@@ -8,7 +8,7 @@ crate-type = ["cdylib"]
[dependencies]
ente-core.workspace = true
ente-ensu-crypto.workspace = true
-ente-wasm-log.workspace = true
+ente-wasm-lib.workspace = true
js-sys.workspace = true
thiserror.workspace = true
wasm-bindgen.workspace = true
diff --git a/rust/bindings/wasm/ensu/src/lib.rs b/rust/bindings/wasm/ensu/src/lib.rs
index 3bace3d364..0c2087f98d 100644
--- a/rust/bindings/wasm/ensu/src/lib.rs
+++ b/rust/bindings/wasm/ensu/src/lib.rs
@@ -1,4 +1,4 @@
-use ente_wasm_log as _;
+use ente_wasm_lib as _;
use wasm_bindgen::prelude::*;
#[derive(Debug, thiserror::Error)]
diff --git a/rust/bindings/wasm/legacy/Cargo.toml b/rust/bindings/wasm/legacy/Cargo.toml
index 208d1dcabd..841d46fdb4 100644
--- a/rust/bindings/wasm/legacy/Cargo.toml
+++ b/rust/bindings/wasm/legacy/Cargo.toml
@@ -10,7 +10,6 @@ ente-accounts.workspace = true
ente-core.workspace = true
ente-legacy.workspace = true
ente-wasm-lib = { workspace = true, features = ["session"] }
-ente-wasm-log.workspace = true
js-sys.workspace = true
serde.workspace = true
serde-wasm-bindgen.workspace = true
diff --git a/rust/bindings/wasm/legacy/src/lib.rs b/rust/bindings/wasm/legacy/src/lib.rs
index 8a76daef12..2a4fa2180d 100644
--- a/rust/bindings/wasm/legacy/src/lib.rs
+++ b/rust/bindings/wasm/legacy/src/lib.rs
@@ -10,8 +10,6 @@ use types::{
};
use wasm_bindgen::prelude::*;
-use ente_wasm_log as _;
-
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error(transparent)]
diff --git a/rust/bindings/wasm/lib/Cargo.toml b/rust/bindings/wasm/lib/Cargo.toml
index 64e65397fb..44ae6bbb5d 100644
--- a/rust/bindings/wasm/lib/Cargo.toml
+++ b/rust/bindings/wasm/lib/Cargo.toml
@@ -23,6 +23,7 @@ ente-accounts = { workspace = true, optional = true }
ente-contacts = { workspace = true, optional = true }
ente-core.workspace = true
js-sys.workspace = true
+log.workspace = true
md-5 = { workspace = true, optional = true }
serde = { workspace = true, optional = true }
serde-wasm-bindgen = { workspace = true, optional = true }
@@ -30,3 +31,4 @@ thiserror.workspace = true
tsify = { workspace = true, optional = true }
wasm-bindgen.workspace = true
wasm-bindgen-futures = { workspace = true, optional = true }
+web-sys = { version = "0.3.102", features = ["console"] }
diff --git a/rust/bindings/wasm/lib/src/lib.rs b/rust/bindings/wasm/lib/src/lib.rs
index b54819f22c..75bd89a766 100644
--- a/rust/bindings/wasm/lib/src/lib.rs
+++ b/rust/bindings/wasm/lib/src/lib.rs
@@ -4,6 +4,7 @@ pub mod accounts;
pub mod contacts;
#[cfg(feature = "crypto")]
pub mod crypto;
+mod logging;
#[cfg(feature = "prelogin")]
mod prelogin;
#[cfg(feature = "session")]
diff --git a/rust/bindings/wasm/log/src/lib.rs b/rust/bindings/wasm/lib/src/logging.rs
similarity index 100%
rename from rust/bindings/wasm/log/src/lib.rs
rename to rust/bindings/wasm/lib/src/logging.rs
diff --git a/rust/bindings/wasm/locker/Cargo.toml b/rust/bindings/wasm/locker/Cargo.toml
index 2abcbea0f5..af79556856 100644
--- a/rust/bindings/wasm/locker/Cargo.toml
+++ b/rust/bindings/wasm/locker/Cargo.toml
@@ -7,4 +7,3 @@ crate-type = ["cdylib"]
[dependencies]
ente-wasm-lib = { workspace = true, features = ["accounts", "contacts", "crypto-file", "crypto-seal"] }
-ente-wasm-log.workspace = true
diff --git a/rust/bindings/wasm/locker/src/lib.rs b/rust/bindings/wasm/locker/src/lib.rs
index 49bcbd3c6c..786e389426 100644
--- a/rust/bindings/wasm/locker/src/lib.rs
+++ b/rust/bindings/wasm/locker/src/lib.rs
@@ -1,2 +1 @@
use ente_wasm_lib as _;
-use ente_wasm_log as _;
diff --git a/rust/bindings/wasm/log/Cargo.toml b/rust/bindings/wasm/log/Cargo.toml
deleted file mode 100644
index 2581e5374e..0000000000
--- a/rust/bindings/wasm/log/Cargo.toml
+++ /dev/null
@@ -1,9 +0,0 @@
-[package]
-name = "ente-wasm-log"
-edition = "2024"
-
-[dependencies]
-js-sys.workspace = true
-log.workspace = true
-wasm-bindgen.workspace = true
-web-sys = { version = "0.3.102", features = ["console"] }
diff --git a/rust/bindings/wasm/paste/Cargo.toml b/rust/bindings/wasm/paste/Cargo.toml
index f1e9d455c8..4981866987 100644
--- a/rust/bindings/wasm/paste/Cargo.toml
+++ b/rust/bindings/wasm/paste/Cargo.toml
@@ -7,8 +7,8 @@ crate-type = ["cdylib"]
[dependencies]
ente-core.workspace = true
-ente-wasm-log.workspace = true
ente-paste.workspace = true
+ente-wasm-lib.workspace = true
js-sys.workspace = true
thiserror.workspace = true
wasm-bindgen.workspace = true
diff --git a/rust/bindings/wasm/paste/src/lib.rs b/rust/bindings/wasm/paste/src/lib.rs
index 7f4444d256..5ceed52eac 100644
--- a/rust/bindings/wasm/paste/src/lib.rs
+++ b/rust/bindings/wasm/paste/src/lib.rs
@@ -1,5 +1,5 @@
use ente_paste::{Client, OpenPaste, PasteSession};
-use ente_wasm_log as _;
+use ente_wasm_lib as _;
use wasm_bindgen::prelude::*;
#[derive(Debug, thiserror::Error)]
diff --git a/rust/bindings/wasm/photos/Cargo.toml b/rust/bindings/wasm/photos/Cargo.toml
index 599de55625..e748bf9518 100644
--- a/rust/bindings/wasm/photos/Cargo.toml
+++ b/rust/bindings/wasm/photos/Cargo.toml
@@ -7,4 +7,3 @@ crate-type = ["cdylib"]
[dependencies]
ente-wasm-lib = { workspace = true, features = ["contacts"] }
-ente-wasm-log.workspace = true
diff --git a/rust/bindings/wasm/photos/src/lib.rs b/rust/bindings/wasm/photos/src/lib.rs
index 49bcbd3c6c..786e389426 100644
--- a/rust/bindings/wasm/photos/src/lib.rs
+++ b/rust/bindings/wasm/photos/src/lib.rs
@@ -1,2 +1 @@
use ente_wasm_lib as _;
-use ente_wasm_log as _;
diff --git a/rust/bindings/wasm/prelogin/Cargo.toml b/rust/bindings/wasm/prelogin/Cargo.toml
index 1f03dd8009..d67128e54c 100644
--- a/rust/bindings/wasm/prelogin/Cargo.toml
+++ b/rust/bindings/wasm/prelogin/Cargo.toml
@@ -7,4 +7,3 @@ crate-type = ["cdylib"]
[dependencies]
ente-wasm-lib = { workspace = true, features = ["prelogin"] }
-ente-wasm-log.workspace = true
diff --git a/rust/bindings/wasm/prelogin/src/lib.rs b/rust/bindings/wasm/prelogin/src/lib.rs
index 49bcbd3c6c..786e389426 100644
--- a/rust/bindings/wasm/prelogin/src/lib.rs
+++ b/rust/bindings/wasm/prelogin/src/lib.rs
@@ -1,2 +1 @@
use ente_wasm_lib as _;
-use ente_wasm_log as _;
diff --git a/rust/bindings/wasm/space/Cargo.toml b/rust/bindings/wasm/space/Cargo.toml
index 19384d1833..924fe5e38d 100644
--- a/rust/bindings/wasm/space/Cargo.toml
+++ b/rust/bindings/wasm/space/Cargo.toml
@@ -8,7 +8,7 @@ crate-type = ["cdylib"]
[dependencies]
ente-core.workspace = true
ente-space.workspace = true
-ente-wasm-log.workspace = true
+ente-wasm-lib.workspace = true
js-sys.workspace = true
log.workspace = true
serde.workspace = true
diff --git a/rust/bindings/wasm/space/src/lib.rs b/rust/bindings/wasm/space/src/lib.rs
index 0bf401d55d..307f0ff6b5 100644
--- a/rust/bindings/wasm/space/src/lib.rs
+++ b/rust/bindings/wasm/space/src/lib.rs
@@ -1,3 +1,3 @@
-use ente_wasm_log as _;
+use ente_wasm_lib as _;
mod space;