This commit is contained in:
problematicconsumer
2023-10-05 22:47:24 +03:30
parent 3aa8273210
commit c96a1ebb20
10 changed files with 26 additions and 25 deletions

View File

@@ -137,7 +137,7 @@ class CoreFacadeImpl with ExceptionHandler, InfraLogger implements CoreFacade {
}).toList();
}).handleExceptions(
(error, stackTrace) {
loggy.warning("error watching outbounds", error, stackTrace);
loggy.error("error watching outbounds", error, stackTrace);
return CoreServiceFailure.unexpected(error, stackTrace);
},
);

View File

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

View File

@@ -109,15 +109,16 @@ class AboutPage extends HookConsumerWidget {
.check();
},
),
ListTile(
title: Text(t.settings.general.openWorkingDir),
trailing: const Icon(Icons.arrow_outward_outlined),
onTap: () async {
final path =
ref.read(filesEditorServiceProvider).workingDir.uri;
await UriUtils.tryLaunch(path);
},
),
if (PlatformUtils.isDesktop)
ListTile(
title: Text(t.settings.general.openWorkingDir),
trailing: const Icon(Icons.arrow_outward_outlined),
onTap: () async {
final path =
ref.read(filesEditorServiceProvider).workingDir.uri;
await UriUtils.tryLaunch(path);
},
),
],
),
),

View File

@@ -73,7 +73,7 @@ class IntroPage extends HookConsumerWidget with PresLogger {
try {
await Sentry.close();
} catch (error, stackTrace) {
loggy.warning(
loggy.error(
"could not disable analytics",
error,
stackTrace,

View File

@@ -123,7 +123,7 @@ class ProxiesNotifier extends _$ProxiesNotifier with AppLogger {
loggy.debug("testing group: [$groupTag]");
if (state case AsyncData()) {
await ref.read(coreFacadeProvider).urlTest(groupTag).getOrElse((err) {
loggy.warning("error testing group", err);
loggy.error("error testing group", err);
throw err;
}).run();
}

View File

@@ -26,7 +26,7 @@ Future<List<InstalledPackageInfo>> installedPackagesInfo(
.watch(platformSettingsProvider)
.getInstalledPackages()
.getOrElse((err) {
_logger.warning("error getting installed packages", err);
_logger.error("error getting installed packages", err);
throw err;
}).run();
}

View File

@@ -191,7 +191,7 @@ class FFISingboxService
_logger.debug("stopping status command client");
final err = _box.stopCommandClient(1).cast<Utf8>().toDartString();
if (err.isNotEmpty) {
_logger.warning("error stopping status client");
_logger.error("error stopping status client");
}
receiver.close();
_statusStream = null;
@@ -200,12 +200,12 @@ class FFISingboxService
(event) {
if (event case String _) {
if (event.startsWith('error:')) {
loggy.warning("[status client] error received: $event");
loggy.error("[status client] error received: $event");
throw event.replaceFirst('error:', "");
}
return event;
}
loggy.warning("[status client] unexpected type, msg: $event");
loggy.error("[status client] unexpected type, msg: $event");
throw "invalid type";
},
);
@@ -215,7 +215,7 @@ class FFISingboxService
.cast<Utf8>()
.toDartString();
if (err.isNotEmpty) {
loggy.warning("error starting status command: $err");
loggy.error("error starting status command: $err");
throw err;
}
@@ -231,7 +231,7 @@ class FFISingboxService
_logger.debug("stopping group command client");
final err = _box.stopCommandClient(4).cast<Utf8>().toDartString();
if (err.isNotEmpty) {
_logger.warning("error stopping group client");
_logger.error("error stopping group client");
}
receiver.close();
_groupsStream = null;
@@ -240,12 +240,12 @@ class FFISingboxService
(event) {
if (event case String _) {
if (event.startsWith('error:')) {
loggy.warning("[group client] error received: $event");
loggy.error("[group client] error received: $event");
throw event.replaceFirst('error:', "");
}
return event;
}
loggy.warning("[group client] unexpected type, msg: $event");
loggy.error("[group client] unexpected type, msg: $event");
throw "invalid type";
},
);
@@ -255,7 +255,7 @@ class FFISingboxService
.cast<Utf8>()
.toDartString();
if (err.isNotEmpty) {
loggy.warning("error starting group command: $err");
loggy.error("error starting group command: $err");
throw err;
}

View File

@@ -120,7 +120,7 @@ class MobileSingboxService
if (event case String _) {
return event;
}
loggy.warning("[group client] unexpected type, msg: $event");
loggy.error("[group client] unexpected type, msg: $event");
throw "invalid type";
},
);

View File

@@ -7,7 +7,7 @@ class SentryLoggyIntegration extends LoggyPrinter
implements Integration<SentryOptions> {
SentryLoggyIntegration({
LogLevel minBreadcrumbLevel = LogLevel.info,
LogLevel minEventLevel = LogLevel.warning,
LogLevel minEventLevel = LogLevel.error,
}) : _minBreadcrumbLevel = minBreadcrumbLevel,
_minEventLevel = minEventLevel;

Submodule libcore updated: 75e342b6ba...dced5a30d0