mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-04-18 20:05:05 -04:00
chore: enable sync log by default
This commit is contained in:
parent
b06a2337a0
commit
4896d7c1be
4 changed files with 10 additions and 14 deletions
|
@ -130,7 +130,7 @@ class CustomAppFlowyCloudView extends StatelessWidget {
|
|||
final List<Widget> children = [];
|
||||
children.addAll([
|
||||
const AppFlowyCloudEnableSync(),
|
||||
const AppFlowyCloudSyncLogEnabled(),
|
||||
// const AppFlowyCloudSyncLogEnabled(),
|
||||
const VSpace(40),
|
||||
]);
|
||||
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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(¶ms.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(())
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue