From 1101c9d72a9d7f439f82e8c94adc78d84bbfd505 Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 2 Apr 2024 20:10:22 +0800 Subject: [PATCH] chore: update logs --- libs/client-api-wasm/src/lib.rs | 1 - libs/client-api/src/collab_sync/plugin.rs | 1 + libs/client-api/src/ws/handler.rs | 4 ++++ libs/wasm-test/tests/user_test.rs | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/client-api-wasm/src/lib.rs b/libs/client-api-wasm/src/lib.rs index 2ba26c1b..71860001 100644 --- a/libs/client-api-wasm/src/lib.rs +++ b/libs/client-api-wasm/src/lib.rs @@ -1,7 +1,6 @@ pub mod entities; use crate::entities::{ClientAPIConfig, ClientResponse}; use client_api::{Client, ClientConfiguration}; -use tracing; use wasm_bindgen::prelude::*; // When the `wee_alloc` feature is enabled, use `wee_alloc` as the global diff --git a/libs/client-api/src/collab_sync/plugin.rs b/libs/client-api/src/collab_sync/plugin.rs index f9812ba1..16854c90 100644 --- a/libs/client-api/src/collab_sync/plugin.rs +++ b/libs/client-api/src/collab_sync/plugin.rs @@ -32,6 +32,7 @@ pub struct SyncPlugin { impl Drop for SyncPlugin { fn drop(&mut self) { + #[cfg(feature = "sync_verbose_log")] trace!("Drop sync plugin: {}", self.object.object_id); } } diff --git a/libs/client-api/src/ws/handler.rs b/libs/client-api/src/ws/handler.rs index b0963220..e0c50061 100644 --- a/libs/client-api/src/ws/handler.rs +++ b/libs/client-api/src/ws/handler.rs @@ -18,6 +18,7 @@ pub struct WebSocketChannel { impl Drop for WebSocketChannel { fn drop(&mut self) { + #[cfg(feature = "sync_verbose_log")] trace!("Drop WebSocketChannel {}", self.object_id); } } @@ -53,6 +54,8 @@ where while let Some(msg) = rx.recv().await { let _ = cloned_sender.send(msg); } + + #[cfg(feature = "sync_verbose_log")] trace!("WebSocketChannel {} sink closed", object_id); }); BroadcastSink::new(tx) @@ -70,6 +73,7 @@ where break; } } + #[cfg(feature = "sync_verbose_log")] trace!("WebSocketChannel {} stream closed", object_id); }); UnboundedReceiverStream::new(rx) diff --git a/libs/wasm-test/tests/user_test.rs b/libs/wasm-test/tests/user_test.rs index acc7e7d9..6a7fdad1 100644 --- a/libs/wasm-test/tests/user_test.rs +++ b/libs/wasm-test/tests/user_test.rs @@ -19,7 +19,7 @@ async fn wasm_sign_in_success() { .sign_in_password(user.email.as_str(), user.password.as_str()) .await; - assert!(res.ok()); + assert!(res.is_ok()); let val = res.unwrap();