Add more logs

This commit is contained in:
problematicconsumer
2023-08-23 00:06:51 +03:30
parent ff8fd230b3
commit 45095745a3
6 changed files with 21 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart'; import 'package:flutter_native_splash/flutter_native_splash.dart';
@@ -49,6 +50,11 @@ Future<void> lazyBootstrap(WidgetsBinding widgetsBinding) async {
), ),
); );
_loggy.debug(
"os: ${Platform.operatingSystem}(${Platform.operatingSystemVersion})",
);
_loggy.debug("basic setup took [${_stopWatch.elapsedMilliseconds}]ms");
final silentStart = final silentStart =
container.read(prefsControllerProvider).general.silentStart; container.read(prefsControllerProvider).general.silentStart;
if (silentStart) { if (silentStart) {
@@ -76,7 +82,7 @@ Future<void> lazyBootstrap(WidgetsBinding widgetsBinding) async {
Future<void> initAppServices( Future<void> initAppServices(
Result Function<Result>(ProviderListenable<Result>) read, Result Function<Result>(ProviderListenable<Result>) read,
) async { ) async {
// await read(filesEditorServiceProvider).init(); _loggy.debug("initializing app services");
await Future.wait( await Future.wait(
[ [
read(connectivityServiceProvider).init(), read(connectivityServiceProvider).init(),

View File

@@ -37,9 +37,12 @@ class ProfilesRepositoryImpl
@override @override
Stream<Either<ProfileFailure, Profile?>> watchActiveProfile() { Stream<Either<ProfileFailure, Profile?>> watchActiveProfile() {
return profilesDao return profilesDao.watchActiveProfile().handleExceptions(
.watchActiveProfile() (error, stackTrace) {
.handleExceptions(ProfileUnexpectedFailure.new); loggy.warning("error watching active profile", error, stackTrace);
return ProfileUnexpectedFailure(error, stackTrace);
},
);
} }
@override @override

View File

@@ -17,6 +17,7 @@ class UpdateRepositoryImpl
TaskEither<UpdateFailure, InstalledVersionInfo> getCurrentVersion() { TaskEither<UpdateFailure, InstalledVersionInfo> getCurrentVersion() {
return exceptionHandler( return exceptionHandler(
() async { () async {
loggy.debug("getting current app version");
final packageInfo = await PackageInfo.fromPlatform(); final packageInfo = await PackageInfo.fromPlatform();
return right( return right(
InstalledVersionInfo( InstalledVersionInfo(
@@ -26,7 +27,10 @@ class UpdateRepositoryImpl
), ),
); );
}, },
UpdateFailure.unexpected, (error, stackTrace) {
loggy.warning("error getting current app version", error, stackTrace);
return UpdateFailure.unexpected(error, stackTrace);
},
); );
} }

View File

@@ -10,6 +10,7 @@ part 'active_profile_notifier.g.dart';
class ActiveProfile extends _$ActiveProfile with AppLogger { class ActiveProfile extends _$ActiveProfile with AppLogger {
@override @override
Stream<Profile?> build() { Stream<Profile?> build() {
loggy.debug("watching active profile");
return ref return ref
.watch(profilesRepositoryProvider) .watch(profilesRepositoryProvider)
.watchActiveProfile() .watchActiveProfile()

View File

@@ -12,6 +12,7 @@ part 'runtime_details.g.dart';
class RuntimeDetailsNotifier extends _$RuntimeDetailsNotifier with AppLogger { class RuntimeDetailsNotifier extends _$RuntimeDetailsNotifier with AppLogger {
@override @override
Future<RuntimeDetails> build() async { Future<RuntimeDetails> build() async {
loggy.debug("initializing");
final appVersion = await ref final appVersion = await ref
.watch(updateRepositoryProvider) .watch(updateRepositoryProvider)
.getCurrentVersion() .getCurrentVersion()

View File

@@ -14,6 +14,7 @@ class DeepLinkService extends _$DeepLinkService
@override @override
Future<NewProfileLink?> build() async { Future<NewProfileLink?> build() async {
if (Platform.isLinux) return null; if (Platform.isLinux) return null;
loggy.debug("initializing");
for (final protocol in _protocols) { for (final protocol in _protocols) {
await protocolHandler.register(protocol); await protocolHandler.register(protocol);
} }