From 06e3d30e0e8e29761aab2c35b842d07bbb4c2f7e Mon Sep 17 00:00:00 2001 From: HuyNguyen Date: Wed, 27 Nov 2024 17:17:34 +0700 Subject: [PATCH] Support enable logs --- config.sample.json | 3 ++- docs/configurations/config_web_app_for_public_platform.md | 4 +++- lib/config/app_config.dart | 3 +++ pubspec.lock | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/config.sample.json b/config.sample.json index acd0b9f10..ef40014e0 100644 --- a/config.sample.json +++ b/config.sample.json @@ -14,5 +14,6 @@ "platform": "platform", "default_max_upload_avatar_size_in_bytes": 1000000, "dev_mode": false, - "qr_code_download_url": "https://sign-up.twake.app/download/chat" + "qr_code_download_url": "https://sign-up.twake.app/download/chat", + "enable_logs": false } diff --git a/docs/configurations/config_web_app_for_public_platform.md b/docs/configurations/config_web_app_for_public_platform.md index 024332e6c..8c1dbb6e1 100644 --- a/docs/configurations/config_web_app_for_public_platform.md +++ b/docs/configurations/config_web_app_for_public_platform.md @@ -29,7 +29,8 @@ in [config.sample.json](https://github.com/linagora/twake-on-matrix/blob/main/co "platform": "platform" "default_max_upload_avatar_size_in_bytes": 1000000, "dev_mode": false, - "qr_code_download_url": "https://example.com/" + "qr_code_download_url": "https://example.com/", + "enable_logs": true } ``` @@ -49,5 +50,6 @@ in [config.sample.json](https://github.com/linagora/twake-on-matrix/blob/main/co - `default_max_upload_avatar_size_in_bytes`: Default max upload avatar size - `dev_mode`: Enable to run app in IDE, - `qr_code_download_url`: URL generate QR code to download app +- `enable_logs`: Enable logs If you want to disable it, please change the value or remove this from `config.sample.json` \ No newline at end of file diff --git a/lib/config/app_config.dart b/lib/config/app_config.dart index 1d6de1cde..69a917b32 100644 --- a/lib/config/app_config.dart +++ b/lib/config/app_config.dart @@ -261,5 +261,8 @@ abstract class AppConfig { if (json['qr_code_download_url'] is String) { qrCodeDownloadUrl = json['qr_code_download_url']; } + if (json['enable_logs'] is bool) { + DebugUtils.enableLogs = json['enable_logs']; + } } } diff --git a/pubspec.lock b/pubspec.lock index b1e90b07a..13640d302 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1894,7 +1894,7 @@ packages: description: path: "." ref: main - resolved-ref: a498051a8a7e41a35bde65f37c25add3f808b929 + resolved-ref: "9353b6d6b6c1b9cc9e9a9290ffd0c777c6a0b479" url: "https://github.com/linagora/dart_matrix_api_lite.git" source: git version: "1.7.4"