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:io';
import 'package:flutter/material.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 =
container.read(prefsControllerProvider).general.silentStart;
if (silentStart) {
@@ -76,7 +82,7 @@ Future<void> lazyBootstrap(WidgetsBinding widgetsBinding) async {
Future<void> initAppServices(
Result Function<Result>(ProviderListenable<Result>) read,
) async {
// await read(filesEditorServiceProvider).init();
_loggy.debug("initializing app services");
await Future.wait(
[
read(connectivityServiceProvider).init(),

View File

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

View File

@@ -17,6 +17,7 @@ class UpdateRepositoryImpl
TaskEither<UpdateFailure, InstalledVersionInfo> getCurrentVersion() {
return exceptionHandler(
() async {
loggy.debug("getting current app version");
final packageInfo = await PackageInfo.fromPlatform();
return right(
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 {
@override
Stream<Profile?> build() {
loggy.debug("watching active profile");
return ref
.watch(profilesRepositoryProvider)
.watchActiveProfile()

View File

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

View File

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