Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

chore: enable sync log by default

Nathan4896d7c1bec9
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/setting_appflowy_cloud.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/setting_appflowy_cloud.dart
index 645c3daa65..a9cb362bf3 100644
--- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/setting_appflowy_cloud.dart
+++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/setting_appflowy_cloud.dart
@@ -130,7 +130,7 @@ class CustomAppFlowyCloudView extends StatelessWidget {
final List<Widget> children = [];
children.addAll([
const AppFlowyCloudEnableSync(),
- const AppFlowyCloudSyncLogEnabled(),
+ // const AppFlowyCloudSyncLogEnabled(),
const VSpace(40),
]);
diff --git a/frontend/rust-lib/flowy-core/src/config.rs b/frontend/rust-lib/flowy-core/src/config.rs
index 2b379ab63a..33386249e6 100644
--- a/frontend/rust-lib/flowy-core/src/config.rs
+++ b/frontend/rust-lib/flowy-core/src/config.rs
@@ -84,14 +84,12 @@ impl AppFlowyCoreConfig {
) -> Self {
let cloud_config = AFCloudConfiguration::from_env().ok();
let mut log_crates = vec![];
+ // By default enable sync trace log
+ log_crates.push("sync_trace_log".to_string());
+
let storage_path = match &cloud_config {
None => custom_application_path,
- Some(config) => {
- if config.enable_sync_trace {
- log_crates.push("sync_trace_log".to_string());
- }
- make_user_data_folder(&custom_application_path, &config.base_url)
- },
+ Some(config) => make_user_data_folder(&custom_application_path, &config.base_url),
};
let log_filter = create_log_filter(
diff --git a/frontend/rust-lib/flowy-document/src/event_handler.rs b/frontend/rust-lib/flowy-document/src/event_handler.rs
index cb16129c40..acf45777eb 100644
--- a/frontend/rust-lib/flowy-document/src/event_handler.rs
+++ b/frontend/rust-lib/flowy-document/src/event_handler.rs
@@ -21,6 +21,7 @@ use crate::parser::parser_entities::{
use crate::{manager::DocumentManager, parser::json::parser::JsonToDocumentParser};
use flowy_error::{FlowyError, FlowyResult};
use lib_dispatch::prelude::{data_result_ok, AFPluginData, AFPluginState, DataResult};
+use lib_infra::sync_trace;
use tracing::instrument;
use uuid::Uuid;
@@ -124,9 +125,7 @@ pub(crate) async fn apply_action_handler(
let doc_id = params.document_id;
let document = manager.editable_document(&doc_id).await?;
let actions = params.actions;
- if cfg!(feature = "verbose_log") {
- tracing::trace!("{} applying actions: {:?}", doc_id, actions);
- }
+ sync_trace!("{} applying action: {:?}", doc_id, actions);
document.write().await.apply_action(actions)?;
Ok(())
}
@@ -141,6 +140,7 @@ pub(crate) async fn create_text_handler(
let doc_id = params.document_id;
let document = manager.editable_document(&doc_id).await?;
let mut document = document.write().await;
+ sync_trace!("{} creating text: {:?}", doc_id, params.delta);
document.apply_text_delta(&params.text_id, params.delta);
Ok(())
}
@@ -157,9 +157,7 @@ pub(crate) async fn apply_text_delta_handler(
let text_id = params.text_id;
let delta = params.delta;
let mut document = document.write().await;
- if cfg!(feature = "verbose_log") {
- tracing::trace!("{} applying delta: {:?}", doc_id, delta);
- }
+ sync_trace!("{} applying delta: {:?}", doc_id, delta);
document.apply_text_delta(&text_id, delta);
Ok(())
}
diff --git a/frontend/rust-lib/flowy-server-pub/src/native/af_cloud_config.rs b/frontend/rust-lib/flowy-server-pub/src/native/af_cloud_config.rs
index 14a72c6ce6..9c74850fcd 100644
--- a/frontend/rust-lib/flowy-server-pub/src/native/af_cloud_config.rs
+++ b/frontend/rust-lib/flowy-server-pub/src/native/af_cloud_config.rs
@@ -60,7 +60,7 @@ impl AFCloudConfiguration {
let enable_sync_trace = std::env::var(APPFLOWY_ENABLE_SYNC_TRACE)
.map(|v| v == "true" || v == "1")
- .unwrap_or(false);
+ .unwrap_or(true);
Ok(Self {
base_url,