From 9353b6d6b6c1b9cc9e9a9290ffd0c777c6a0b479 Mon Sep 17 00:00:00 2001 From: Huy Quang Nguyen Date: Thu, 28 Nov 2024 09:40:56 +0700 Subject: [PATCH] Support enable logs (#4) --- lib/matrix_api_lite.dart | 1 + lib/src/utils/debug_utils.dart | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lib/matrix_api_lite.dart b/lib/matrix_api_lite.dart index 77a4e4e..6ac32de 100644 --- a/lib/matrix_api_lite.dart +++ b/lib/matrix_api_lite.dart @@ -66,3 +66,4 @@ export 'src/utils/logs.dart'; export 'src/utils/map_copy_extension.dart'; export 'src/utils/try_get_map_extension.dart'; export 'src/values.dart'; +export 'src/utils/debug_utils.dart'; diff --git a/lib/src/utils/debug_utils.dart b/lib/src/utils/debug_utils.dart index 97eafcd..2646fdf 100644 --- a/lib/src/utils/debug_utils.dart +++ b/lib/src/utils/debug_utils.dart @@ -2,6 +2,8 @@ class DebugUtils { static final DebugUtils _instance = DebugUtils._internal(); + static bool enableLogs = false; + DebugUtils._internal(); factory DebugUtils() { @@ -9,6 +11,9 @@ class DebugUtils { } bool get isDebugMode { + if (enableLogs) { + return enableLogs; + } bool inDebugMode = false; assert(inDebugMode = true); return inDebugMode;