From 8dd3b78e9947b1fe889a733720621e8f217b1469 Mon Sep 17 00:00:00 2001 From: Damian Molinski Date: Tue, 10 Sep 2024 16:28:39 +0200 Subject: [PATCH 1/6] feat: LoggingManager implementation --- .../lib/configs/app_bloc_observer.dart | 11 ++- catalyst_voices/lib/configs/bootstrap.dart | 80 +++++++++++++--- .../lib/dependency/dependencies.dart | 8 ++ catalyst_voices/lib/routes/app_router.dart | 4 +- .../lib/src/catalyst_voices_shared.dart | 1 + .../lib/src/logging/logging_manager.dart | 92 +++++++++++++++++++ .../catalyst_voices_shared/pubspec.yaml | 1 + melos.yaml | 1 + 8 files changed, 178 insertions(+), 20 deletions(-) create mode 100644 catalyst_voices/packages/catalyst_voices_shared/lib/src/logging/logging_manager.dart diff --git a/catalyst_voices/lib/configs/app_bloc_observer.dart b/catalyst_voices/lib/configs/app_bloc_observer.dart index 666ae7630d9..4f2d250dbda 100644 --- a/catalyst_voices/lib/configs/app_bloc_observer.dart +++ b/catalyst_voices/lib/configs/app_bloc_observer.dart @@ -1,15 +1,18 @@ -import 'dart:developer'; - +import 'package:catalyst_voices_shared/catalyst_voices_shared.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; final class AppBlocObserver extends BlocObserver { + AppBlocObserver(); + + final _logger = Logger('AppBlocObserver'); + @override void onChange( BlocBase bloc, Change change, ) { super.onChange(bloc, change); - log('onChange(${bloc.runtimeType}, $change)'); + _logger.info('onChange(${bloc.runtimeType}, $change)'); } @override @@ -18,7 +21,7 @@ final class AppBlocObserver extends BlocObserver { Object error, StackTrace stackTrace, ) { - log('onError(${bloc.runtimeType}, $error, $stackTrace)'); + _logger.warning('onError(${bloc.runtimeType})', error, stackTrace); super.onError(bloc, error, stackTrace); } } diff --git a/catalyst_voices/lib/configs/bootstrap.dart b/catalyst_voices/lib/configs/bootstrap.dart index dbf2dbbf1ad..b914ab6c322 100644 --- a/catalyst_voices/lib/configs/bootstrap.dart +++ b/catalyst_voices/lib/configs/bootstrap.dart @@ -1,5 +1,5 @@ import 'dart:async'; -import 'dart:developer'; +import 'dart:io'; import 'package:catalyst_voices/app/app.dart'; import 'package:catalyst_voices/configs/app_bloc_observer.dart'; @@ -7,6 +7,7 @@ import 'package:catalyst_voices/configs/sentry_service.dart'; import 'package:catalyst_voices/dependency/dependencies.dart'; import 'package:catalyst_voices/routes/guards/milestone_guard.dart'; import 'package:catalyst_voices/routes/routes.dart'; +import 'package:catalyst_voices_shared/catalyst_voices_shared.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -23,13 +24,25 @@ final class BootstrapArgs { }); } -// TODO(damian-molinski): Add PlatformDispatcher.instance.onError // TODO(damian-molinski): Add Isolate.current.addErrorListener -// TODO(damian-molinski): Add runZonedGuarded -// TODO(damian-molinski): Add Global try-catch Future bootstrap([ - BootstrapWidgetBuilder builder = _appBuilder, + BootstrapWidgetBuilder builder = _defaultBuilder, ]) async { + runZonedGuarded( + () => _safeBootstrap(builder), + _reportUncouthZoneError, + ); +} + +Future _safeBootstrap(BootstrapWidgetBuilder builder) async { + try { + await _doBootstrap(builder); + } catch (error, stack) { + await _reportBootstrapError(error, stack); + } +} + +Future _doBootstrap(BootstrapWidgetBuilder builder) async { // There's no need to call WidgetsFlutterBinding.ensureInitialized() // since this is already done internally by SentryFlutter.init() // More info here: https://github.com/getsentry/sentry-dart/issues/2063 @@ -37,12 +50,14 @@ Future bootstrap([ WidgetsFlutterBinding.ensureInitialized(); } - FlutterError.onError = (details) { - log( - details.exceptionAsString(), - stackTrace: details.stack, - ); - }; + FlutterError.onError = _reportFlutterError; + PlatformDispatcher.instance.onError = _reportPlatformDispatcherError; + + await Dependencies.instance.init(); + + final loggerManager = Dependencies.instance.get(); + loggerManager.level = kDebugMode ? Level.ALL : Level.OFF; + loggerManager.printLogs = kDebugMode; GoRouter.optionURLReflectsImperativeAPIs = true; setPathUrlStrategy(); @@ -55,11 +70,10 @@ Future bootstrap([ Bloc.observer = AppBlocObserver(); - await Dependencies.instance.init(); - final args = BootstrapArgs(routerConfig: router); + final app = await builder(args); - await _runApp(await builder(args)); + await _runApp(app); } Future _runApp(Widget app) async { @@ -70,8 +84,44 @@ Future _runApp(Widget app) async { } } -Widget _appBuilder(BootstrapArgs args) { +Widget _defaultBuilder(BootstrapArgs args) { return App( routerConfig: args.routerConfig, ); } + +Future _reportBootstrapError(Object error, StackTrace stack) async { + if (kDebugMode) { + debugPrint('Bootstrap Error'); + debugPrint(error.toString()); + debugPrintStack(stackTrace: stack, label: 'Bootstrap'); + } +} + +/// Flutter-specific assertion failures and contract violations. +Future _reportFlutterError(FlutterErrorDetails details) async { + if (kDebugMode) FlutterError.presentError(details); + + // Crashes app. + if (kReleaseMode) exit(1); +} + +/// Platform Dispatcher Errors reporting +bool _reportPlatformDispatcherError(Object error, StackTrace stack) { + if (kDebugMode) { + debugPrint('PlatformDispatcher Error'); + debugPrint(error.toString()); + debugPrintStack(stackTrace: stack, label: 'PlatformDispatcher'); + } + + return true; +} + +/// Uncouth Errors reporting +void _reportUncouthZoneError(Object error, StackTrace stack) { + if (kDebugMode) { + debugPrint('UncouthZoneError Error'); + debugPrint(error.toString()); + debugPrintStack(stackTrace: stack, label: 'UncouthZoneError'); + } +} diff --git a/catalyst_voices/lib/dependency/dependencies.dart b/catalyst_voices/lib/dependency/dependencies.dart index 2fb658298d7..dcfb7bf80ba 100644 --- a/catalyst_voices/lib/dependency/dependencies.dart +++ b/catalyst_voices/lib/dependency/dependencies.dart @@ -11,6 +11,7 @@ final class Dependencies extends DependencyProvider { Future init() async { DependencyProvider.instance = this; _registerServices(); + _registerManagers(); _registerRepositories(); _registerBlocsWithDependencies(); } @@ -46,4 +47,11 @@ final class Dependencies extends DependencyProvider { SecureStorageService(), ); } + + void _registerManagers() { + registerLazySingleton( + () => LoggingManager(), + dispose: (manager) => manager.dispose(), + ); + } } diff --git a/catalyst_voices/lib/routes/app_router.dart b/catalyst_voices/lib/routes/app_router.dart index 9e43ba20b9b..00889b44c65 100644 --- a/catalyst_voices/lib/routes/app_router.dart +++ b/catalyst_voices/lib/routes/app_router.dart @@ -15,7 +15,6 @@ abstract final class AppRouter { List guards = const [], }) { return GoRouter( - debugLogDiagnostics: true, navigatorKey: _rootNavigatorKey, initialLocation: Routes.initialLocation, redirect: (context, state) => _guard(context, state, guards), @@ -23,6 +22,9 @@ abstract final class AppRouter { SentryNavigatorObserver(), ], routes: Routes.routes, + // always true. We're deciding whether to print + // them or not in LoggingManager + debugLogDiagnostics: true, ); } diff --git a/catalyst_voices/packages/catalyst_voices_shared/lib/src/catalyst_voices_shared.dart b/catalyst_voices/packages/catalyst_voices_shared/lib/src/catalyst_voices_shared.dart index f80314f6864..3c5ed51dc3b 100644 --- a/catalyst_voices/packages/catalyst_voices_shared/lib/src/catalyst_voices_shared.dart +++ b/catalyst_voices/packages/catalyst_voices_shared/lib/src/catalyst_voices_shared.dart @@ -2,6 +2,7 @@ export 'common/build_config.dart'; export 'common/build_environment.dart'; export 'dependency/dependency_provider.dart'; export 'formatter/cryptocurrency_formatter.dart'; +export 'logging/logging_manager.dart'; export 'platform/catalyst_platform.dart'; export 'platform_aware_builder/platform_aware_builder.dart'; export 'responsive/responsive_builder.dart'; diff --git a/catalyst_voices/packages/catalyst_voices_shared/lib/src/logging/logging_manager.dart b/catalyst_voices/packages/catalyst_voices_shared/lib/src/logging/logging_manager.dart new file mode 100644 index 00000000000..ae566ce973f --- /dev/null +++ b/catalyst_voices/packages/catalyst_voices_shared/lib/src/logging/logging_manager.dart @@ -0,0 +1,92 @@ +import 'dart:async'; +import 'dart:developer' as developer; + +import 'package:flutter/foundation.dart'; +import 'package:logging/logging.dart'; + +export 'package:logging/logging.dart' show Level, Logger; + +abstract interface class LoggingManager { + factory LoggingManager() { + return _LoggingManagerImpl(root: Logger.root); + } + + set level(Level newValue); + + set printLogs(bool newValue); + + void dispose(); +} + +final class _LoggingManagerImpl implements LoggingManager { + final Logger root; + + StreamSubscription? _recordsSub; + + _LoggingManagerImpl({ + required this.root, + }) : _printLogs = false { + hierarchicalLoggingEnabled = true; + + root.level = Level.OFF; + _recordsSub = root.onRecord.listen(_onLogRecord); + } + + @override + set level(Level newValue) { + if (root.level == newValue) { + return; + } + root.level = newValue; + } + + bool get printLogs => _printLogs; + + bool _printLogs; + + @override + set printLogs(bool newValue) { + if (_printLogs == newValue) { + return; + } + _printLogs = newValue; + } + + @override + void dispose() { + _recordsSub?.cancel(); + _recordsSub = null; + + root.clearListeners(); + } + + void _onLogRecord(LogRecord log) { + if (_printLogs) { + _printLogRecord(log); + } + } + + void _printLogRecord(LogRecord log) { + if (log.level >= Level.SEVERE) { + final error = log.error; + final errorDetails = FlutterErrorDetails( + exception: error is Exception ? error : Exception(error), + stack: log.stackTrace, + library: log.loggerName, + context: ErrorDescription(log.message), + ); + FlutterError.dumpErrorToConsole(errorDetails); + } else { + developer.log( + log.message, + time: log.time, + sequenceNumber: log.sequenceNumber, + level: log.level.value, + name: log.loggerName, + zone: log.zone, + error: log.error, + stackTrace: log.stackTrace, + ); + } + } +} diff --git a/catalyst_voices/packages/catalyst_voices_shared/pubspec.yaml b/catalyst_voices/packages/catalyst_voices_shared/pubspec.yaml index fa0fa9dec3c..452215ebc2c 100644 --- a/catalyst_voices/packages/catalyst_voices_shared/pubspec.yaml +++ b/catalyst_voices/packages/catalyst_voices_shared/pubspec.yaml @@ -14,6 +14,7 @@ dependencies: sdk: flutter get_it: ^7.6.7 intl: ^0.19.0 + logging: ^1.2.0 web: ^0.5.0 dev_dependencies: diff --git a/melos.yaml b/melos.yaml index 8c95322cce0..c0a5ed1d221 100644 --- a/melos.yaml +++ b/melos.yaml @@ -27,6 +27,7 @@ command: flutter_quill: ^10.5.0 flutter_quill_extensions: ^10.5.0 formz: ^0.7.0 + logging: ^1.2.0 meta: ^1.10.0 result_type: ^0.2.0 plugin_platform_interface: ^2.1.7 From 650b4165c43bee8cb8a2971ee90f48fcc67fb484 Mon Sep 17 00:00:00 2001 From: Damian Molinski Date: Wed, 11 Sep 2024 10:24:58 +0200 Subject: [PATCH 2/6] fix: typo --- catalyst_voices/lib/configs/bootstrap.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst_voices/lib/configs/bootstrap.dart b/catalyst_voices/lib/configs/bootstrap.dart index b914ab6c322..d8422e8aeb3 100644 --- a/catalyst_voices/lib/configs/bootstrap.dart +++ b/catalyst_voices/lib/configs/bootstrap.dart @@ -117,7 +117,7 @@ bool _reportPlatformDispatcherError(Object error, StackTrace stack) { return true; } -/// Uncouth Errors reporting +/// Uncaught Errors reporting void _reportUncouthZoneError(Object error, StackTrace stack) { if (kDebugMode) { debugPrint('UncouthZoneError Error'); From 134a03276a6122bb09fa3c01e576164941c04229 Mon Sep 17 00:00:00 2001 From: Damian Molinski Date: Wed, 11 Sep 2024 10:27:23 +0200 Subject: [PATCH 3/6] refactor: rename LoggingManager to LoggingService --- catalyst_voices/lib/configs/bootstrap.dart | 6 +++--- .../lib/dependency/dependencies.dart | 19 ++++++++----------- .../lib/src/catalyst_voices_shared.dart | 2 +- ...ging_manager.dart => logging_service.dart} | 10 +++++----- 4 files changed, 17 insertions(+), 20 deletions(-) rename catalyst_voices/packages/catalyst_voices_shared/lib/src/logging/{logging_manager.dart => logging_service.dart} (89%) diff --git a/catalyst_voices/lib/configs/bootstrap.dart b/catalyst_voices/lib/configs/bootstrap.dart index d8422e8aeb3..3aff202d1f8 100644 --- a/catalyst_voices/lib/configs/bootstrap.dart +++ b/catalyst_voices/lib/configs/bootstrap.dart @@ -55,9 +55,9 @@ Future _doBootstrap(BootstrapWidgetBuilder builder) async { await Dependencies.instance.init(); - final loggerManager = Dependencies.instance.get(); - loggerManager.level = kDebugMode ? Level.ALL : Level.OFF; - loggerManager.printLogs = kDebugMode; + final loggingService = Dependencies.instance.get(); + loggingService.level = kDebugMode ? Level.ALL : Level.OFF; + loggingService.printLogs = kDebugMode; GoRouter.optionURLReflectsImperativeAPIs = true; setPathUrlStrategy(); diff --git a/catalyst_voices/lib/dependency/dependencies.dart b/catalyst_voices/lib/dependency/dependencies.dart index dcfb7bf80ba..6ed6965fe0e 100644 --- a/catalyst_voices/lib/dependency/dependencies.dart +++ b/catalyst_voices/lib/dependency/dependencies.dart @@ -11,7 +11,6 @@ final class Dependencies extends DependencyProvider { Future init() async { DependencyProvider.instance = this; _registerServices(); - _registerManagers(); _registerRepositories(); _registerBlocsWithDependencies(); } @@ -43,15 +42,13 @@ final class Dependencies extends DependencyProvider { } void _registerServices() { - registerSingleton( - SecureStorageService(), - ); - } - - void _registerManagers() { - registerLazySingleton( - () => LoggingManager(), - dispose: (manager) => manager.dispose(), - ); + this + ..registerSingleton( + SecureStorageService(), + ) + ..registerLazySingleton( + () => LoggingService(), + dispose: (manager) => manager.dispose(), + ); } } diff --git a/catalyst_voices/packages/catalyst_voices_shared/lib/src/catalyst_voices_shared.dart b/catalyst_voices/packages/catalyst_voices_shared/lib/src/catalyst_voices_shared.dart index 3c5ed51dc3b..b0ad6521971 100644 --- a/catalyst_voices/packages/catalyst_voices_shared/lib/src/catalyst_voices_shared.dart +++ b/catalyst_voices/packages/catalyst_voices_shared/lib/src/catalyst_voices_shared.dart @@ -2,7 +2,7 @@ export 'common/build_config.dart'; export 'common/build_environment.dart'; export 'dependency/dependency_provider.dart'; export 'formatter/cryptocurrency_formatter.dart'; -export 'logging/logging_manager.dart'; +export 'logging/logging_service.dart'; export 'platform/catalyst_platform.dart'; export 'platform_aware_builder/platform_aware_builder.dart'; export 'responsive/responsive_builder.dart'; diff --git a/catalyst_voices/packages/catalyst_voices_shared/lib/src/logging/logging_manager.dart b/catalyst_voices/packages/catalyst_voices_shared/lib/src/logging/logging_service.dart similarity index 89% rename from catalyst_voices/packages/catalyst_voices_shared/lib/src/logging/logging_manager.dart rename to catalyst_voices/packages/catalyst_voices_shared/lib/src/logging/logging_service.dart index ae566ce973f..2c018de8071 100644 --- a/catalyst_voices/packages/catalyst_voices_shared/lib/src/logging/logging_manager.dart +++ b/catalyst_voices/packages/catalyst_voices_shared/lib/src/logging/logging_service.dart @@ -6,9 +6,9 @@ import 'package:logging/logging.dart'; export 'package:logging/logging.dart' show Level, Logger; -abstract interface class LoggingManager { - factory LoggingManager() { - return _LoggingManagerImpl(root: Logger.root); +abstract interface class LoggingService { + factory LoggingService() { + return _LoggingServiceImpl(root: Logger.root); } set level(Level newValue); @@ -18,12 +18,12 @@ abstract interface class LoggingManager { void dispose(); } -final class _LoggingManagerImpl implements LoggingManager { +final class _LoggingServiceImpl implements LoggingService { final Logger root; StreamSubscription? _recordsSub; - _LoggingManagerImpl({ + _LoggingServiceImpl({ required this.root, }) : _printLogs = false { hierarchicalLoggingEnabled = true; From e09f85340a1f7a7866b6d147e06523adbc3179c2 Mon Sep 17 00:00:00 2001 From: Damian Molinski Date: Wed, 11 Sep 2024 11:55:10 +0200 Subject: [PATCH 4/6] refactor: make LoggingService global and initialized as first in bootstrap --- catalyst_voices/lib/configs/bootstrap.dart | 44 ++++++++----------- .../lib/dependency/dependencies.dart | 11 ++--- .../lib/src/logging/logging_service.dart | 25 +++++------ 3 files changed, 34 insertions(+), 46 deletions(-) diff --git a/catalyst_voices/lib/configs/bootstrap.dart b/catalyst_voices/lib/configs/bootstrap.dart index 3aff202d1f8..209d96cea10 100644 --- a/catalyst_voices/lib/configs/bootstrap.dart +++ b/catalyst_voices/lib/configs/bootstrap.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:io'; import 'package:catalyst_voices/app/app.dart'; import 'package:catalyst_voices/configs/app_bloc_observer.dart'; @@ -14,6 +13,13 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:url_strategy/url_strategy.dart'; +final _loggingService = LoggingService(); + +final _bootstrapLogger = Logger('Bootstrap'); +final _flutterLogger = Logger('Flutter'); +final _platformDispatcherLogger = Logger('PlatformDispatcher'); +final _uncouthZoneLogger = Logger('UncouthZone'); + typedef BootstrapWidgetBuilder = FutureOr Function(BootstrapArgs args); final class BootstrapArgs { @@ -50,15 +56,15 @@ Future _doBootstrap(BootstrapWidgetBuilder builder) async { WidgetsFlutterBinding.ensureInitialized(); } + _loggingService + ..level = kDebugMode ? Level.ALL : Level.OFF + ..printLogs = kDebugMode; + FlutterError.onError = _reportFlutterError; PlatformDispatcher.instance.onError = _reportPlatformDispatcherError; await Dependencies.instance.init(); - final loggingService = Dependencies.instance.get(); - loggingService.level = kDebugMode ? Level.ALL : Level.OFF; - loggingService.printLogs = kDebugMode; - GoRouter.optionURLReflectsImperativeAPIs = true; setPathUrlStrategy(); @@ -91,37 +97,25 @@ Widget _defaultBuilder(BootstrapArgs args) { } Future _reportBootstrapError(Object error, StackTrace stack) async { - if (kDebugMode) { - debugPrint('Bootstrap Error'); - debugPrint(error.toString()); - debugPrintStack(stackTrace: stack, label: 'Bootstrap'); - } + _bootstrapLogger.severe('Error while bootstrapping', error, stack); } /// Flutter-specific assertion failures and contract violations. Future _reportFlutterError(FlutterErrorDetails details) async { - if (kDebugMode) FlutterError.presentError(details); - - // Crashes app. - if (kReleaseMode) exit(1); + _flutterLogger.severe( + details.context?.toStringDeep(), + details.exception, + details.stack, + ); } /// Platform Dispatcher Errors reporting bool _reportPlatformDispatcherError(Object error, StackTrace stack) { - if (kDebugMode) { - debugPrint('PlatformDispatcher Error'); - debugPrint(error.toString()); - debugPrintStack(stackTrace: stack, label: 'PlatformDispatcher'); - } - + _platformDispatcherLogger.severe('Platform Error', error, stack); return true; } /// Uncaught Errors reporting void _reportUncouthZoneError(Object error, StackTrace stack) { - if (kDebugMode) { - debugPrint('UncouthZoneError Error'); - debugPrint(error.toString()); - debugPrintStack(stackTrace: stack, label: 'UncouthZoneError'); - } + _uncouthZoneLogger.severe('Uncouth Error', error, stack); } diff --git a/catalyst_voices/lib/dependency/dependencies.dart b/catalyst_voices/lib/dependency/dependencies.dart index 6ed6965fe0e..2fb658298d7 100644 --- a/catalyst_voices/lib/dependency/dependencies.dart +++ b/catalyst_voices/lib/dependency/dependencies.dart @@ -42,13 +42,8 @@ final class Dependencies extends DependencyProvider { } void _registerServices() { - this - ..registerSingleton( - SecureStorageService(), - ) - ..registerLazySingleton( - () => LoggingService(), - dispose: (manager) => manager.dispose(), - ); + registerSingleton( + SecureStorageService(), + ); } } diff --git a/catalyst_voices/packages/catalyst_voices_shared/lib/src/logging/logging_service.dart b/catalyst_voices/packages/catalyst_voices_shared/lib/src/logging/logging_service.dart index 2c018de8071..f05a9cb974c 100644 --- a/catalyst_voices/packages/catalyst_voices_shared/lib/src/logging/logging_service.dart +++ b/catalyst_voices/packages/catalyst_voices_shared/lib/src/logging/logging_service.dart @@ -56,8 +56,6 @@ final class _LoggingServiceImpl implements LoggingService { void dispose() { _recordsSub?.cancel(); _recordsSub = null; - - root.clearListeners(); } void _onLogRecord(LogRecord log) { @@ -76,17 +74,18 @@ final class _LoggingServiceImpl implements LoggingService { context: ErrorDescription(log.message), ); FlutterError.dumpErrorToConsole(errorDetails); - } else { - developer.log( - log.message, - time: log.time, - sequenceNumber: log.sequenceNumber, - level: log.level.value, - name: log.loggerName, - zone: log.zone, - error: log.error, - stackTrace: log.stackTrace, - ); + return; } + + developer.log( + log.message, + time: log.time, + sequenceNumber: log.sequenceNumber, + level: log.level.value, + name: log.loggerName, + zone: log.zone, + error: log.error, + stackTrace: log.stackTrace, + ); } } From baf06756bd23e89412476e1d5687997997f40183 Mon Sep 17 00:00:00 2001 From: Damian Molinski Date: Wed, 11 Sep 2024 11:56:44 +0200 Subject: [PATCH 5/6] fix: typo --- catalyst_voices/lib/routes/app_router.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst_voices/lib/routes/app_router.dart b/catalyst_voices/lib/routes/app_router.dart index 00889b44c65..0c38d308adf 100644 --- a/catalyst_voices/lib/routes/app_router.dart +++ b/catalyst_voices/lib/routes/app_router.dart @@ -23,7 +23,7 @@ abstract final class AppRouter { ], routes: Routes.routes, // always true. We're deciding whether to print - // them or not in LoggingManager + // them or not in LoggingService debugLogDiagnostics: true, ); } From 5b445ef4008d6573969ae155cebbb2edffd2b37c Mon Sep 17 00:00:00 2001 From: Damian Molinski Date: Wed, 11 Sep 2024 12:57:27 +0200 Subject: [PATCH 6/6] chore: typos --- catalyst_voices/lib/configs/bootstrap.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/catalyst_voices/lib/configs/bootstrap.dart b/catalyst_voices/lib/configs/bootstrap.dart index 209d96cea10..b7bb5350c63 100644 --- a/catalyst_voices/lib/configs/bootstrap.dart +++ b/catalyst_voices/lib/configs/bootstrap.dart @@ -18,7 +18,7 @@ final _loggingService = LoggingService(); final _bootstrapLogger = Logger('Bootstrap'); final _flutterLogger = Logger('Flutter'); final _platformDispatcherLogger = Logger('PlatformDispatcher'); -final _uncouthZoneLogger = Logger('UncouthZone'); +final _uncaughtZoneLogger = Logger('UncaughtZone'); typedef BootstrapWidgetBuilder = FutureOr Function(BootstrapArgs args); @@ -36,7 +36,7 @@ Future bootstrap([ ]) async { runZonedGuarded( () => _safeBootstrap(builder), - _reportUncouthZoneError, + _reportUncaughtZoneError, ); } @@ -116,6 +116,6 @@ bool _reportPlatformDispatcherError(Object error, StackTrace stack) { } /// Uncaught Errors reporting -void _reportUncouthZoneError(Object error, StackTrace stack) { - _uncouthZoneLogger.severe('Uncouth Error', error, stack); +void _reportUncaughtZoneError(Object error, StackTrace stack) { + _uncaughtZoneLogger.severe('Uncaught Error', error, stack); }