Skip to content

Commit

Permalink
#355: added logs and log detail screen
Browse files Browse the repository at this point in the history
  • Loading branch information
jorre127 committed Oct 15, 2024
1 parent 58f2392 commit ea7550b
Show file tree
Hide file tree
Showing 28 changed files with 644 additions and 97 deletions.
12 changes: 12 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ PODS:
- PromisesSwift (~> 2.1)
- FirebaseSharedSwift (10.29.0)
- Flutter (1.0.0)
- flutter_key_value_file_storage (0.0.1):
- Flutter
- flutter_secure_file_storage (0.0.1):
- Flutter
- flutter_secure_storage (6.0.0):
- Flutter
- GoogleAppMeasurement (10.25.0):
Expand Down Expand Up @@ -195,6 +199,8 @@ DEPENDENCIES:
- firebase_crashlytics (from `.symlinks/plugins/firebase_crashlytics/ios`)
- firebase_remote_config (from `.symlinks/plugins/firebase_remote_config/ios`)
- Flutter (from `Flutter`)
- flutter_key_value_file_storage (from `.symlinks/plugins/flutter_key_value_file_storage/ios`)
- flutter_secure_file_storage (from `.symlinks/plugins/flutter_secure_file_storage/ios`)
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
Expand Down Expand Up @@ -240,6 +246,10 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/firebase_remote_config/ios"
Flutter:
:path: Flutter
flutter_key_value_file_storage:
:path: ".symlinks/plugins/flutter_key_value_file_storage/ios"
flutter_secure_file_storage:
:path: ".symlinks/plugins/flutter_secure_file_storage/ios"
flutter_secure_storage:
:path: ".symlinks/plugins/flutter_secure_storage/ios"
path_provider_foundation:
Expand Down Expand Up @@ -273,6 +283,8 @@ SPEC CHECKSUMS:
FirebaseSessions: dbd14adac65ce996228652c1fc3a3f576bdf3ecc
FirebaseSharedSwift: 20530f495084b8d840f78a100d8c5ee613375f6e
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_key_value_file_storage: b91fb1747ffa3e36810c752a1763655fda0b9f3d
flutter_secure_file_storage: cdf659810f1849916ea5371ed5df339a3aaa802c
flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12
GoogleAppMeasurement: 9abf64b682732fed36da827aa2a68f0221fd2356
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
Expand Down
4 changes: 4 additions & 0 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@
"${BUILT_PRODUCTS_DIR}/ReachabilitySwift/Reachability.framework",
"${BUILT_PRODUCTS_DIR}/connectivity_plus/connectivity_plus.framework",
"${BUILT_PRODUCTS_DIR}/device_info_plus/device_info_plus.framework",
"${BUILT_PRODUCTS_DIR}/flutter_key_value_file_storage/flutter_key_value_file_storage.framework",
"${BUILT_PRODUCTS_DIR}/flutter_secure_file_storage/flutter_secure_file_storage.framework",
"${BUILT_PRODUCTS_DIR}/flutter_secure_storage/flutter_secure_storage.framework",
"${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
"${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framework",
Expand Down Expand Up @@ -343,6 +345,8 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity_plus.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info_plus.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_key_value_file_storage.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_secure_file_storage.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_secure_storage.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework",
Expand Down
8 changes: 8 additions & 0 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import 'package:flutter_template/viewmodel/global/global_viewmodel.dart';
import 'package:flutter_template/widget/general/flavor_banner.dart';
import 'package:flutter_template/widget/general/text_scale_factor.dart';
import 'package:flutter_template/widget/provider/provider_widget.dart';
import 'package:icapps_architecture/icapps_architecture.dart';
import 'package:log_to_secure_file/log_to_secure_file.dart';

class MyApp extends StatelessWidget {
const MyApp({super.key});
Expand All @@ -23,6 +25,12 @@ class MyApp extends StatelessWidget {
systemNavigationBarColor: Colors.transparent,
));
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);

// init logger
final fileLogger = getIt.get<SecureLogStorage>();
fileLogger.init();
LoggingFactory.configure(LoggingConfiguration(onLog: (value) => fileLogger.storeLogLine(value)));

return const InternalApp();
}
}
Expand Down
156 changes: 84 additions & 72 deletions lib/di/injectable.config.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions lib/di/injectable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import 'package:flutter_template/util/interceptor/network_refresh_interceptor.da
import 'package:get_it/get_it.dart';
import 'package:icapps_architecture/icapps_architecture.dart';
import 'package:injectable/injectable.dart';
import 'package:log_to_secure_file/log_to_secure_file.dart';
import 'package:shared_preferences/shared_preferences.dart';

final getIt = GetIt.asNewInstance();
Expand Down Expand Up @@ -60,6 +61,9 @@ abstract class RegisterModule {
return createDriftDatabaseConnection('db');
}

@lazySingleton
SecureLogStorage provideSecureLogStorage(SecureStorage secureStorage) => SecureLogStorage();

@lazySingleton
FirebaseAnalytics provideFirebaseAnalytics() => FirebaseAnalytics.instance;

Expand Down
2 changes: 2 additions & 0 deletions lib/navigator/main_navigator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class MainNavigator with BaseNavigator {

static String get initialRoute => FlavorConfig.isInTest() ? 'test_route' : RouteNames.splashScreen;

BuildContext get context => navigatorKey.currentContext!;

static List<NavigatorObserver> get navigatorObservers => _navigatorObservers;

Future<void> goToDatabase(GeneratedDatabase db) async => _navigator.push<void>(MaterialPageRoute(builder: (context) => DriftDbViewer(db)));
Expand Down
Loading

0 comments on commit ea7550b

Please sign in to comment.